Android drawCircle is not always 360 degrees

When I call drawCircle (for example canvas.drawCircle(x, y, r, mPaint);

) and I use Paint Style STROKE

to initialize the parameter mPaint

, the result doesn't quite make a full 360 degree (2 * PI radian) circle in all cases. Sometimes you get a full circle (as you would expect) and sometimes only an arc.

Does anyone have an idea what might happen?

I don't know which cases are working and which are not (yet). I noticed that the ones that are not working appear to be large circles that I am drawing (radius 100.0). May be related to size. I am using floating point for x, y and r. I could try rounding to the nearest int when in the drawing code.

+2


a source to share


1 answer


Do you do anything else on the canvas before drawCircle? This can happen if, for example, you scale or transform the canvas before drawing the circle.



0


a source







All Articles