Skip to content

Commit 8d5bed2

Browse files
committed
[Win32] Apply accessibility setting to ImageDataProvider-based cursor
Cursors are scaled according to the accessibility settings of Windows. However, this setting is only applied to Cursor instances based on image data but not on those that are instantiated via an ImageDataProvider. This change also applies the scale factor in the latter case.
1 parent a0d6ffc commit 8d5bed2

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,12 @@ public ImageDataProviderCursorHandleProvider(ImageDataProvider provider, int hot
628628
@Override
629629
public CursorHandle createHandle(Device device, int zoom) {
630630
ImageData source;
631+
int scaledZoom = (int) (zoom * getPointerSizeScaleFactor());
631632
if (zoom == DEFAULT_ZOOM) {
632-
source = this.provider.getImageData(DEFAULT_ZOOM);
633+
source = this.provider.getImageData(scaledZoom);
633634
} else {
634635
Image tempImage = new Image(device, this.provider);
635-
source = tempImage.getImageData(zoom);
636+
source = tempImage.getImageData(scaledZoom);
636637
tempImage.dispose();
637638
}
638639
return setupCursorFromImageData(device, source, null, getHotpotXInPixels(zoom), getHotpotYInPixels(zoom));

0 commit comments

Comments
 (0)