Commit 55b5adf
[Win32] Fix cut off controls #2641
In HiDPI scenarios with fractional monitor scales (such as 125% and
175%), some controls appear slightly cut off. The reason for this is
inconsistent rounding of control sizes. The rounding is necessary during
pixel/point conversion and leads to added or lost single pixels. One
controls which obviously shows the behavior is the border of
CTabFolders.
This change adapts the calculation in the following way:
- It ensures that pixelToPoint and pointToPixel conversions for sizes
round in opposite ways instead of rounding up in both directions as
currently done. This ensures that sizes being set (via pointToPixel) are
rounded up while sizes being retrieved (via pixelToPoint) are rounded
down.
- It extracts the pixelToPoint conversion for sizes that are calculated
based on pixel values and are supposed to represent a conservative size
(i.e., better be to high than to low).
- It ensures that also the pixelToPoint conversion of rectangles takes
the proper rounding method for sizes into account.
Fixes #26411 parent cf6ee39 commit 55b5adf
File tree
5 files changed
+13
-6
lines changed- bundles/org.eclipse.swt/Eclipse SWT
- common/org/eclipse/swt/graphics
- win32/org/eclipse/swt
- internal
- widgets
- tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/tests/win32
5 files changed
+13
-6
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
148 | | - | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
| 626 | + | |
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
0 commit comments