Skip to content

Commit 2cd0808

Browse files
vogellaakurtakov
authored andcommitted
Update Starfield migration based on review feedback
- Use modern Color constructor without device parameter. - Remove manual Color disposal as it's now handled by SWT.
1 parent 84a9535 commit 2cd0808

File tree

1 file changed

+1
-2
lines changed
  • examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics

1 file changed

+1
-2
lines changed

examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarfieldTab.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ public void paint(GC gc, int width, int height) {
9797
final int tempy = (int) (stars[i].ypos / stars[i].zpos + height / 2);
9898

9999
if (tempx >= 0 && tempx < width && tempy >= 0 && tempy < height) {
100-
Color color = new Color(gc.getDevice(), stars[i].color, stars[i].color, stars[i].color);
100+
Color color = new Color(stars[i].color, stars[i].color, stars[i].color);
101101
gc.setForeground(color);
102102
gc.drawPoint(tempx, tempy);
103-
color.dispose();
104103
}
105104
}
106105
}

0 commit comments

Comments
 (0)