Commit c3cebe8
[win32] Fix pointer size scaling precision for custom cursors
The value in the registry for CursorBaseSize is not always divisible by
32, so integer division was causing loss of precision in pointer
scaling. This commit changes getPointerSizeScaleFactor() to return a
float using floating-point division, and ensures all usages of this
method in Cursor.java handle the scale as a float. The float is then
cast to int only when calling DPIUtil.scaleImageData, which only accepts
integer zoom values. This preserves as much precision as possible and
avoids rounding errors in pointer scaling for accessibility settings.1 parent 87fa834 commit c3cebe8
File tree
1 file changed
+10
-7
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics
1 file changed
+10
-7
lines changedLines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
652 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
653 | 654 | | |
654 | 655 | | |
655 | 656 | | |
| |||
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
683 | | - | |
684 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
685 | 688 | | |
686 | 689 | | |
687 | 690 | | |
| |||
0 commit comments