Skip to content

Commit cb50254

Browse files
Fix flaky graphics-draw-arc test by correcting arc dimensions
The original test code incorrectly used absolute coordinates (right/bottom edges) as width/height arguments for `drawArc`, causing massive arcs to be drawn outside the component bounds. This likely led to rendering artifacts and flakiness on Android. This change updates the logic to draw concentric arcs that stay within the component bounds.
1 parent c4df216 commit cb50254

File tree

1 file changed

+1
-1
lines changed
  • scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/graphics

1 file changed

+1
-1
lines changed

scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/graphics/DrawArc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ protected void drawContent(Graphics g, Rectangle bounds) {
1010
g.setColor(0xffffff);
1111
for (int iter = 0 ; iter < bounds.getWidth() / 2 ; iter++) {
1212
nextColor(g);
13-
g.drawArc(bounds.getX() + iter, bounds.getY() + iter, bounds.getX() + bounds.getWidth() - iter, bounds.getY() + bounds.getHeight() + iter, iter, 180);
13+
g.drawArc(bounds.getX() + iter, bounds.getY() + iter, bounds.getWidth() - iter * 2, bounds.getHeight() - iter * 2, iter, 180);
1414
}
1515
}
1616

0 commit comments

Comments
 (0)