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) 
}

Parents
  • 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:

Comment
  • 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:

Children