-
Notifications
You must be signed in to change notification settings - Fork 184
[Win32] Fix cut-off controls #2641 #2654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3f02e31 to
e83370e
Compare
| public void scaleDownRectangle() { | ||
| Rectangle valueAt200 = new Rectangle(100, 150, 10, 14); | ||
| Rectangle valueAt150 = new Rectangle(75, 113, 7, 10); | ||
| Rectangle valueAt150 = new Rectangle(75, 113, 8, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this aligns the test values with the opposite scaleUpRectangle() method, which also makes the behavior appear more consistent again.
e83370e to
431b1ef
Compare
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 eclipse-platform#2641
431b1ef to
b9e9aef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code lokes solid and matches the description. As this is a topic we are addressing over quite some time there is always a risk of breaking something. This PR fixes issues that were after the latest refactoring. As I didn't find any regression when testing it on different zoom levels, I would give this a go. It improves the visible behavior and we have more time to see, if we introduce any regression with this.
|
With some further testing I noticed some issues regarding jface forms, but they appear in the same way on master. Therefor we need to investigate that separately and is not a blocker for this PR |
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:
Fixes #2641
Before
After
Note that the Manifest editor is shown because you can also see improper changes of the scaling when resizing that editor based on the Forms UI, in particular with cut off lines when resizing vertically.