Skip to content

Commit 941ff78

Browse files
HeikoKlareakoch-yatta
authored andcommitted
[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 f275dba commit 941ff78

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ public ImageDataProviderCursorHandleProvider(ImageDataProvider provider, int hot
628628
@Override
629629
public CursorHandle createHandle(Device device, int zoom) {
630630
Image tempImage = new Image(device, this.provider);
631-
ImageData source = tempImage.getImageData(zoom);
631+
int scaledZoom = (int) (zoom * getPointerSizeScaleFactor());
632+
ImageData source = tempImage.getImageData(scaledZoom);
632633
tempImage.dispose();
633634
return setupCursorFromImageData(device, source, null, getHotpotXInPixels(zoom), getHotpotYInPixels(zoom));
634635
}

0 commit comments

Comments
 (0)