drawArc vs. drawCircle

I am getting this both on the simulator and on my 935.

This produces a nice circle with a round hole:

dc.setColor(Gfx.COLOR_DK_GREEN, Gfx.COLOR_TRANSPARENT);
dc.setPenWidth(20);
dc.drawArc(120, 120,30,0,0,0 );


This produces a squared off circle with a squared off hole:

dc.setColor(Gfx.COLOR_DK_GREEN, Gfx.COLOR_TRANSPARENT);
dc.setPenWidth(20);
dc.drawCircle(120, 120,30);



Why is there a difference between drawing a circle and drawing an arc through 360 degrees?



  • Not sure about this one, but if the sim reflects what you see on the device, then the sim is correct for how the FW does it. The FW may have a bug, but who knows when that may change or how many other devices also do the same thing.

    My guess, is that drawArc is more expensive than drawCircle, so I'd not use that for this.

    Have you tried with fillCircle? use a radius of 30 with the dark green, and then with a radius of 10 with white on top? setPenWidth could be confusing things, and this way, you don't need to set it.
  • Thanks for the reply Jim. I am aware I can do it with fillCircle (in fact I have moved away from the doughnut idea so I don't even need the white bit any longer) but that doesn't take away from the fact that an arc drawn through 360 degrees should produce the same result as drawing a circle. At least you confirm my idea that it is some sort of bug as supposed to a code error on my behalf.
  • You probably want to submit a bug report in the CIQ bug report forum.. The sticky there has things to include, like the SDK version, firmware version, etc.
  • FWIW...See my bug report and note Brian's comment:
    "There are a lot of issues with the details of the graphics APIs, and unfortunately I can't offer much beyond an apology in the short term. Long term, we plan to spend time giving the graphics module the attention it needs. If you see any more discrepancies like this one, please continue to report them. I am filing tickets to address these types of errors. Any drawing accuracy issues should be high on our priority list when this work gets rolling."
    ....