Commit 336726b
committed
Only use double-precision translation when HighDPI scaling is enabled
When the "draw2d.enableAutoscale" system property is enabled, additional
(scalable) layers are injected into the IFigure hierarchy to take the
monitor zoom into consideration.
As a result of this, translating geometric shapes may cause additional
rounding errors, which are the result of translating integer-values with
an additional, fractional zoom level.
To work around this problem, the "useDoublePrecision()" method was added
with 5cfe5b7, which converts the
geometric shapes to their precise variants. This conversion is generally
not backwards compatible.
To make sure clients can fully opt-out of this new behavior, this
conversion should only be done when the "draw2d.enableAutoscale" is set
to true, meaning only when these new layers are added, that require this
extended translation logic.1 parent 88b83cf commit 336726b
File tree
3 files changed
+11
-2
lines changed- org.eclipse.draw2d.tests/src/org/eclipse/draw2d/test
- org.eclipse.draw2d/src/org/eclipse/draw2d
3 files changed
+11
-2
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| |||
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
0 commit comments