Skip to content

Commit

Permalink
Adapt Snippet367 and Snippet382 to ImageGcDrawer
Browse files Browse the repository at this point in the history
Two snippets refer to an old signature of the ImageGcDrawer interface,
leading to compilation issues. This change change adapts them
accordingly.
  • Loading branch information
HeikoKlare committed Jan 19, 2025
1 parent c493ae8 commit d441a95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public static void main (String [] args) {
return null;
}
};
final ImageGcDrawer imageGcDrawer = gc -> {
gc.drawRectangle(1, 1, 18, 18);
gc.drawLine(3, 3, 17, 17);
final ImageGcDrawer imageGcDrawer = (gc, width, height) -> {
gc.drawRectangle(1, 1, width - 2, height - 2);
gc.drawLine(3, 3, width - 3, height - 3);
};

final Display display = new Display ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public static void main (String [] args) {

final Display display = new Display ();

final ImageGcDrawer imageGcDrawer = gc -> {
final ImageGcDrawer imageGcDrawer = (gc, width, height) -> {
gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
gc.fillRectangle(0, 0, 16, 16);
gc.fillRectangle(0, 0, width, height);
gc.setForeground(display.getSystemColor(SWT.COLOR_YELLOW));
gc.drawRectangle(4, 4, 8, 8);
gc.drawRectangle(4, 4, width - 8, height - 8);
};

final Shell shell = new Shell (display);
Expand Down

0 comments on commit d441a95

Please sign in to comment.