Skip to content

Commit 0859644

Browse files
Fix flaky graphics-draw-arc test logic (#4319)
* 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. * Updated screenshot --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Shai Almog <[email protected]>
1 parent 608f4ff commit 0859644

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed
-55.2 KB
Loading

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)