@@ -320,14 +320,15 @@ public static Long win32_getHandle (Cursor cursor, int zoom) {
320320 if (cursor .isDisposed ()) {
321321 return 0L ;
322322 }
323- if (cursor .zoomLevelToHandle .get (zoom ) != null ) {
324- return cursor .zoomLevelToHandle .get (zoom ).getHandle ();
323+ int zoomWithPointerSizeScaleFactor = (int ) (zoom * getPointerSizeScaleFactor ());
324+ if (cursor .zoomLevelToHandle .get (zoomWithPointerSizeScaleFactor ) != null ) {
325+ return cursor .zoomLevelToHandle .get (zoomWithPointerSizeScaleFactor ).getHandle ();
325326 }
326327
327- CursorHandle handle = cursor .cursorHandleProvider .createHandle (cursor .device , zoom );
328- cursor .setHandleForZoomLevel (handle , zoom );
328+ CursorHandle handle = cursor .cursorHandleProvider .createHandle (cursor .device , zoomWithPointerSizeScaleFactor );
329+ cursor .setHandleForZoomLevel (handle , zoomWithPointerSizeScaleFactor );
329330
330- return cursor .zoomLevelToHandle .get (zoom ).getHandle ();
331+ return cursor .zoomLevelToHandle .get (zoomWithPointerSizeScaleFactor ).getHandle ();
331332}
332333
333334private void setHandleForZoomLevel (CursorHandle handle , Integer zoom ) {
@@ -628,10 +629,9 @@ public ImageDataProviderCursorHandleProvider(ImageDataProvider provider, int hot
628629 @ Override
629630 public CursorHandle createHandle (Device device , int zoom ) {
630631 Image tempImage = new Image (device , this .provider );
631- int scaledZoom = (int ) (zoom * getPointerSizeScaleFactor ());
632- ImageData source = tempImage .getImageData (scaledZoom );
632+ ImageData source = tempImage .getImageData (zoom );
633633 tempImage .dispose ();
634- return setupCursorFromImageData (device , source , null , getHotpotXInPixels (scaledZoom ), getHotpotYInPixels (scaledZoom ));
634+ return setupCursorFromImageData (device , source , null , getHotpotXInPixels (zoom ), getHotpotYInPixels (zoom ));
635635 }
636636}
637637
@@ -647,11 +647,9 @@ public ImageDataCursorHandleProvider(ImageData source, int hotspotX, int hotspot
647647
648648 @ Override
649649 public CursorHandle createHandle (Device device , int zoom ) {
650- float accessibilityFactor = getPointerSizeScaleFactor ();
651- int scaledZoom = (int ) (zoom * accessibilityFactor );
652- ImageData scaledSource = DPIUtil .scaleImageData (device , this .source , scaledZoom , DEFAULT_ZOOM );
653- return setupCursorFromImageData (device , scaledSource , null , getHotpotXInPixels (scaledZoom ),
654- getHotpotYInPixels (scaledZoom ));
650+ ImageData scaledSource = DPIUtil .scaleImageData (device , this .source , zoom , DEFAULT_ZOOM );
651+ return setupCursorFromImageData (device , scaledSource , null , getHotpotXInPixels (zoom ),
652+ getHotpotYInPixels (zoom ));
655653 }
656654}
657655
@@ -680,8 +678,7 @@ private void validateMask(ImageData source, ImageData mask) {
680678
681679 @ Override
682680 public CursorHandle createHandle (Device device , int zoom ) {
683- int scaledZoom = (int ) (zoom * getPointerSizeScaleFactor ());
684- float scaledZoomFactor = scaledZoom / 100f ;
681+ float scaledZoomFactor = zoom / 100f ;
685682 int scaledSourceWidth = Math .round (this .source .width * scaledZoomFactor );
686683 int scaledSourceHeight = Math .round (this .source .height * scaledZoomFactor );
687684 ImageData scaledSource = this .source .scaledTo (scaledSourceWidth , scaledSourceHeight );
@@ -691,8 +688,8 @@ public CursorHandle createHandle(Device device, int zoom) {
691688 int scaledMaskHeight = Math .round (this .mask .height * scaledZoomFactor );
692689 scaledMask = this .mask .scaledTo (scaledMaskWidth , scaledMaskHeight );
693690 }
694- return setupCursorFromImageData (device , scaledSource , scaledMask , getHotpotXInPixels (scaledZoom ),
695- getHotpotYInPixels (scaledZoom ));
691+ return setupCursorFromImageData (device , scaledSource , scaledMask , getHotpotXInPixels (zoom ),
692+ getHotpotYInPixels (zoom ));
696693 }
697694}
698695
0 commit comments