Complete
over 4 years ago

WERETECH-8292

This just has to make it's way into firmware now.

Rending Issue in dc.drawArc() with large arc radius

There is an issue where arcs are rendered incorrectly when using a radius of 256 or greater. There is no mention in the documentation of a maximum supported radius value. This is easily reproduced in the simulator and on physical devices using SDK 3.1.6 and earlier.

The following is an example which should produce 4 similar concentric arcs, but the two larger ones have gaps in them as shown in the screenshot:

function onUpdate(dc) {
	dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_TRANSPARENT);
	dc.setPenWidth(10);
	
	dc.drawArc(350, 200, 220, Graphics.ARC_CLOCKWISE, 190, 150); 		// Renders fine (radius < 256)
    dc.drawArc(350, 200, 250, Graphics.ARC_CLOCKWISE, 190, 150); 		// Renders fine (radius < 256)   		
	dc.drawArc(350, 200, 280, Graphics.ARC_CLOCKWISE, 190, 150); 		// Incorrect display (radius >= 256) 
	dc.drawArc(350, 200, 310, Graphics.ARC_CLOCKWISE, 190, 150); 		// Incorrect display (radius >= 256) 
}

  • Thanks for the feedback on this issue, I'm glad to hear it has been fixed and look forward to seeing the roll-out in future updates!

  • Thanks for the report Brian has fixed the issue as you can see in his comment, so this issue will be coming soon.

  • Former Member
    Former Member over 4 years ago

    Thanks for the report. As you might suspect based on what you're seeing here, there is an overflow occurring in the arc rendering code in our graphics engine. There isn't an easy to pin down limit on radius because it also relates to the location of the center point and the actual drawing location of the arc. I've corrected the issue, but I don't know what kind of timeline devices will be on to pull in the fix from the engine and get updates out.

  • The problem goes beyond what I originally described - arcs with radius above & also below 256 sometimes result in drawing outside the start & end angles!

    Changing the y co-ordinate in the above drawArc() calls from 200 to 120 produces the unexpected arc segments visible near the bottom of the screen: