Project: SWT
Bug 107048 Path.moveTo draws lines
Reported: 2005-08-15 12:52:53 | Status: resolved fixed

See the following code fragment: Device device = Display.getDefault(); Image image = new Image(device,100,100); GC gc = new GC(image); Path path = new Path(device); path.moveTo(10,10); path.lineTo(90,10); path.moveTo(10,90); // <== draws a line on Windows path.lineTo(90,90); Color black = new Color(device,0,0,0); gc.setForeground(black); gc.drawPath(path); black.dispose(); gc.dispose(); ImageLoader loader = new ImageLoader(); loader.data = new ImageData[1]; loader.data[0] = image.getImageData(); loader.save("test.jpg", SWT.IMAGE_JPEG); image.dispose(); This should build a Path with two lines and draw it on the image. On Windows XP SP2 with Java 5.0 Update 4, the second moveTo also draws a line (see the created image file). On OSX with Java 5.0, it works as expected.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java