diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java index 4133afb1516..fc5b6aee5b5 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java @@ -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 (); diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java index ff40443deea..821cfcec277 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java @@ -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);