Commit 6b82f88
committed
[90] Fix cursor initialization when using fractional scaling
Recent Eclipse version support fractional zoom level as opposed to 100%
or 200% zoom. Because no icons exist for those levels, an
IllegalArgumentException is thrown when trying to create the
corresponding cursors.
In order to solve this, one has to consider the following cases:
1) Newer SWT versions provide a Cursor constructor that accepts an
ImageDataProvider. This constructor always creates image data matching
the device zoom. However, this constructor crashes when PNGs are used
and the automatic UI scaling is disabled.
2) Older SWT versions automatically upscales the image data to
match the device zoom. On Windows, the image data should always be at
100% because SWT internally scales the image to match the device zoom.
Sadly, this doesn't work either. So on both Windows and Non-Windows
systems, the image must be pre-scaled to the device zoom. This means
that on Windows, the cursor is always scaled twice.1 parent 0be4aeb commit 6b82f88
File tree
1 file changed
+52
-4
lines changed- bundles/org.eclipse.gmf.runtime.gef.ui/src/org/eclipse/gmf/runtime/gef/ui/internal/l10n
1 file changed
+52
-4
lines changedLines changed: 52 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
41 | | - | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
45 | 78 | | |
46 | 79 | | |
47 | 80 | | |
| |||
56 | 89 | | |
57 | 90 | | |
58 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
59 | 107 | | |
0 commit comments