Skip to content
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

[win32] Scale up bounds as rectangle in canvas #1761

Conversation

akoch-yatta
Copy link
Contributor

@akoch-yatta akoch-yatta commented Jan 24, 2025

This PR addresses render artifacts visible in StyledText with monitor-specific scaling enabled e.g. on 175% with quarter scaling mode. Reason is that scaling up all attributes of bounds separately can lead to rounding errors e.g. between y and height (one being scaled up, the other one not). Scaling them together as a rectangle solves this limitation.

Before

Black lines appear, because for each four lines the y is scaled up (e.g. from 50.5 to 51), but the height was not scaled up (25.25 is always 25) -> one pixel is skipped each four lines when drawing the background
Screenshot 2025-01-24 111846

After

Screenshot 2025-01-24 111822

The effect is usually only visible if multiple connecting background chunks are drawn, but the wrong values would be produced in all scenarios.

The same issue is probably hidden in other places as well, e.g. in GC when something should be scaled as rectangle but is scaled independently. We will try to find use cases and fix them one by one.

Copy link
Contributor

github-actions bot commented Jan 24, 2025

Test Results

   494 files  +  2     494 suites  +2   9m 18s ⏱️ + 2m 25s
 4 330 tests +227   4 317 ✅ +221   13 💤 + 6  0 ❌ ±0 
16 568 runs  +417  16 460 ✅ +401  108 💤 +16  0 ❌ ±0 

Results for commit a8d8084. ± Comparison against base commit 413426e.

♻️ This comment has been updated with latest results.

This commit adresses render artifacts visible in StyledText with
monitor-specific scaling enabled e.g. on 175%. Reason is that scaling
up all attributes of bounds separately can lead to rounding errors e.g.
between y and height (one being scaled up, the other one not). Scaling
them together as a rectangle solves this limitation.
@HeikoKlare HeikoKlare merged commit 8d65ddc into eclipse-platform:master Jan 24, 2025
14 checks passed
@HeikoKlare HeikoKlare deleted the fix-scaling-of-background-drawing branch January 24, 2025 17:35
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.

Rendering artifacts with swt.autoScale=quarter at particular zoom levels
2 participants