Skip to content

Commit 18d4990

Browse files
HeikoKlareakoch-yatta
authored andcommitted
[Win32] Remove unnecessary special case for Cursor image data retrieval
A special case for retrieving image data for a cursor directly from the ImageDataProvider when requesting at 100% was unnecessarily added and not removed during a refactoring as it was late in the development cycle and no regression risk wanted to be taken. This now cleans up the according code and makes the image data always be retrieved from an image instance instead of the ImageDataProvider directly.
1 parent 6cca260 commit 18d4990

File tree

1 file changed

+3
-8
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+3
-8
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,9 @@ public ImageDataProviderCursorHandleProvider(ImageDataProvider provider, int hot
627627

628628
@Override
629629
public CursorHandle createHandle(Device device, int zoom) {
630-
ImageData source;
631-
if (zoom == DEFAULT_ZOOM) {
632-
source = this.provider.getImageData(DEFAULT_ZOOM);
633-
} else {
634-
Image tempImage = new Image(device, this.provider);
635-
source = tempImage.getImageData(zoom);
636-
tempImage.dispose();
637-
}
630+
Image tempImage = new Image(device, this.provider);
631+
ImageData source = tempImage.getImageData(zoom);
632+
tempImage.dispose();
638633
return setupCursorFromImageData(device, source, null, getHotpotXInPixels(zoom), getHotpotYInPixels(zoom));
639634
}
640635
}

0 commit comments

Comments
 (0)