Commit 147e135
committed
When computing the size of a widget always return values rounded up
When converting pixels to point there can be depending on the zoom level
be a fractional result.
Currently in all cases these result is converted into an integer using
`Math.round()` that will make values `+/-0.5` resulting in small values
to be round towards a smaller value.
While it is maybe valid for a _location_, when using points to express a
_dimension_ this is not okay as it will result in the reported (integer)
value to be to small leading to errors when the SWT API is then used
after performing additional computations maybe.
See
- eclipse-platform#2381
- eclipse-platform#21661 parent 4d72e87 commit 147e135
File tree
34 files changed
+156
-103
lines changed- bundles/org.eclipse.swt
- Eclipse SWT AWT/win32/org/eclipse/swt/awt
- Eclipse SWT Browser/win32/org/eclipse/swt/browser
- Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd
- Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32
- Eclipse SWT
- common/org/eclipse/swt/graphics
- win32/org/eclipse/swt
- graphics
- internal
- widgets
- tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/tests/win32
34 files changed
+156
-103
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1880 | 1880 | | |
1881 | 1881 | | |
1882 | 1882 | | |
1883 | | - | |
| 1883 | + | |
1884 | 1884 | | |
1885 | 1885 | | |
1886 | 1886 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | | - | |
| 990 | + | |
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| |||
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
162 | | - | |
| 169 | + | |
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | | - | |
| 174 | + | |
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
| 529 | + | |
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
| 1059 | + | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| |||
1868 | 1868 | | |
1869 | 1869 | | |
1870 | 1870 | | |
1871 | | - | |
1872 | | - | |
| 1871 | + | |
| 1872 | + | |
1873 | 1873 | | |
1874 | 1874 | | |
1875 | 1875 | | |
| |||
2039 | 2039 | | |
2040 | 2040 | | |
2041 | 2041 | | |
2042 | | - | |
| 2042 | + | |
2043 | 2043 | | |
2044 | 2044 | | |
2045 | 2045 | | |
| |||
2457 | 2457 | | |
2458 | 2458 | | |
2459 | 2459 | | |
2460 | | - | |
| 2460 | + | |
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
| |||
2643 | 2643 | | |
2644 | 2644 | | |
2645 | 2645 | | |
2646 | | - | |
| 2646 | + | |
2647 | 2647 | | |
2648 | 2648 | | |
2649 | 2649 | | |
| |||
5736 | 5736 | | |
5737 | 5737 | | |
5738 | 5738 | | |
5739 | | - | |
| 5739 | + | |
5740 | 5740 | | |
5741 | 5741 | | |
5742 | 5742 | | |
| |||
5781 | 5781 | | |
5782 | 5782 | | |
5783 | 5783 | | |
5784 | | - | |
| 5784 | + | |
5785 | 5785 | | |
5786 | 5786 | | |
5787 | 5787 | | |
| |||
5816 | 5816 | | |
5817 | 5817 | | |
5818 | 5818 | | |
5819 | | - | |
| 5819 | + | |
5820 | 5820 | | |
5821 | 5821 | | |
5822 | 5822 | | |
| |||
0 commit comments