Skip to content

Conversation

@arunjose696
Copy link
Contributor

@arunjose696 arunjose696 commented Jan 6, 2026

When resizing or expanding scrollable with styled text (e.g. Git revision information), the width of the newly painted region can be small such that they are non-zero in pixels but rounded down to zero in points (after pixelToPoint call). This causes StyledText::handlePaint to skip drawing due to the below check , resulting in visible artifact lines.

if (event.width == 0 || event.height == 0) return; link

Using float-based bounds preserves these non-zero regions from being rounded to zero in points and prevents missed paint operations during resize.

Steps to reproduce:

(Originally posted by @HeikoKlare in vi-eclipse/Eclipse-Platform#560)

  • Open a current IDE on a 150% monitor
  • Open any Java file under Git version control and show the revision information in the ruler (right click -> "Team" -> "Show revision information")
  • Hover over any of the markers with changes, such that the window with detail information appears
  • Slowing increase the width of that window
  • Artifact lines like the one mentioned in Artifacts when resizing EGit blame window at 150% monitor zoom vi-eclipse/Eclipse-Platform#560 appears without this change,

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Test Results (win32)

   27 files   -  7     27 suites   - 7   5m 12s ⏱️ + 1m 2s
4 575 tests  - 57  4 504 ✅  - 55  70 💤  - 3  1 ❌ +1 
  110 runs   - 57    110 ✅  - 54   0 💤  - 3  0 ❌ ±0 

For more details on these failures, see this check.

Results for commit 92ec31a. ± Comparison against base commit ddac0aa.

This pull request removes 57 tests.
AllWin32Tests ImageWin32Tests ‑ testDisposeDrawnImageBeforeRequestingTargetForOtherZoom
AllWin32Tests ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[1] true
AllWin32Tests ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[2] false
AllWin32Tests ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
AllWin32Tests ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
AllWin32Tests ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[1] true
AllWin32Tests ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[2] false
AllWin32Tests ImageWin32Tests ‑ test_getImageData_fromCopiedImage
AllWin32Tests ImageWin32Tests ‑ test_getImageData_fromImageForImageDataFromImage
AllWin32Tests TestTreeColumn ‑ test_ColumnOrder
…

♻️ 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.

LGTM, the change makes sense and fixes the issue as describes. The only risk I see is that the bounds could now be bigger (in pixels) as requested when scaling up again and could render too much instead of too less. With some testing I could not find any of those scenarios happening, as the OS is already correctly clipping the region to render correctly to e.g. 1 px

Set paint event bounds using Rectangle.ofFloat in WM_PAINT to prevent rounding errors from pixel-to-point conversions.

The current issue being solved with this is, when resizing or expanding scrollables with styled text (e.g. Git revision information), the width of the newly painted region can be small such that they are non-zero in pixels but rounded down to zero in points (after pixelToPoint call). This causes StyledText::handlePaint to skip drawing due to event.width == 0, resulting in visible rendering artifacts.

Using float-based bounds preserves non-zero regions and prevents missed paint operations during resize.
@akoch-yatta akoch-yatta force-pushed the arunjose696/560/EgitArtifacts branch from 6196a28 to 92ec31a Compare January 8, 2026 12:47
@akoch-yatta akoch-yatta merged commit 4420b90 into eclipse-platform:master Jan 9, 2026
31 of 32 checks passed
@akoch-yatta akoch-yatta deleted the arunjose696/560/EgitArtifacts branch January 9, 2026 09:38
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 when resizing EGit blame window at 150% monitor zoom

2 participants