-
Notifications
You must be signed in to change notification settings - Fork 188
Artifacts due to rounding errors in StyledText #2076
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
2e8eee4 to
d1c3141
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.
Looks good to me. Didn't find any issues when testing this. As drawInPixels is a package protected method I think its fine to change the params, there are no usages besides the adapted ones. I don't see any other chance to fix this behavior besides scaling everything together
I only have the two remarks to rename the params in the other drawInPixelsMethods
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
Outdated
Show resolved
Hide resolved
90c57a6 to
fa5b738
Compare
2875a89 to
1cd558e
Compare
fedejeanne
left a comment
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.
While selecting the text in code editor the styled text have some artifacts/blank lines due to rounding error while translating points to pixel. Now we are passing the x and y in drawInPixels method in points instead of pixels and expecting it to be scaled up in the method.
HeikoKlare
left a comment
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.
Works for most users, just not for me on my Windows 10
|
Thank you all for testing it! Since the problem seems to be on my machine, I accepted this PR because it improves the situation for most users. @ShahzaibIbrahim I would like a follow-up PR to see if we can fix the issue on my machine too, I'll ping you later so you can help me develop it. I assume that the deciding factor here is my Windows 10 since I know that you, Andreas and Heiko all use Windows 11 and I know that Heiko has the exact same monitor that I have (and he also tested with the same configuration that I tested with). |


While selecting the text in code editor the styled text have some artifacts/blank lines due to rounding error while translating points to pixel. Now we are passing the x and y in drawInPixels method in points instead of pixels and expecting it to be scaled up in the method.
How To Test
RuntimeWorkspacewith the following VM Arguments with primary monitor zoom of 175%Screenshot
Before:

After:
