Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

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

  • Run the RuntimeWorkspace with the following VM Arguments with primary monitor zoom of 175%
-Dswt.autoScale=quarter
-Dswt.autoScale.updateOnRuntime=true
  • Write some code/text in the text editor
  • Select the code block with mouse
  • See if the there are any artifact in between lines

Screenshot

Before:
image

After:
image

@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2025

Test Results

   545 files  +  9     545 suites  +9   31m 47s ⏱️ + 4m 54s
 4 376 tests +230   4 358 ✅ +225   18 💤 +5  0 ❌ ±0 
16 643 runs  +423  16 503 ✅ +414  140 💤 +9  0 ❌ ±0 

Results for commit fc13d0e. ± Comparison against base commit 2fc2e21.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a 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

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-251 branch 2 times, most recently from 90c57a6 to fa5b738 Compare April 30, 2025 09:56
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-251 branch 2 times, most recently from 2875a89 to 1cd558e Compare May 5, 2025 08:35
Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm testing this and I still see the lines:

image

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.
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected for me on 175% primary monitor (and also on 125% secondary):
image

@fedejeanne fedejeanne dismissed their stale review May 5, 2025 15:01

Works for most users, just not for me on my Windows 10

@fedejeanne fedejeanne merged commit 195a3bf into eclipse-platform:master May 5, 2025
17 checks passed
@fedejeanne fedejeanne deleted the master-251 branch May 5, 2025 15:01
@fedejeanne
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Artifacts due to rounding errors in StyledText

4 participants