I'm trying to use a RectF
to drawOval()
and then again to try and drawRect()
. The oval shows up, but the rectangle does not.
//onDraw
RectF rectF = new RectF(300, 300, 100, 100);
canvas.drawRect(rectF, paint); //doesn't display
canvas.drawOval(rectF, paint); //displays
Simple question, but I have no idea why it wouldn't want to draw this shape. My only idea is that this not working so far is that drawRect doesn't like when the end points are "before" the starting points.
EDIT: If I switch the numbers is works, but I need it to be able to accept any numbers, since in my actual application the numbers are dynamically input from the touch point of the user.
//onDraw
RectF rectF = new RectF(100, 100, 300, 300); //switched the coordinates
canvas.drawRect(rectF, paint); //displays
canvas.drawOval(rectF, paint); //displays