Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

This commit unifies scale up results in different places. With zoom values not dividable by 100 scaling up via rectangle or scaling up all values separately can give different result. Scaling always as rectangle solves this limitation.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 31, 2025

Test Results

   494 files  ±0     494 suites  ±0   10m 1s ⏱️ - 1m 6s
 4 333 tests ±0   4 320 ✅ ±0   13 💤 ±0  0 ❌ ±0 
16 574 runs  ±0  16 466 ✅ ±0  108 💤 ±0  0 ❌ ±0 

Results for commit 9b4e9ba. ± Comparison against base commit cfbd282.

♻️ This comment has been updated with latest results.

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.

Changes looks sound to me. I was only wondering about whether scaling destination coordinates independently is correct, but found that to be fine (in particular since source x/y are only used for "correcting" width/height).

Like posted for related PRs: This is part of completing a fix in 2016 (3b55f60) improving the initial HiDPI support (e02d49a) for fractional scale values, which was only applied to according calculations in DPIUtil but not to all consumers that contained the same inaccuracy.

width = DPIUtil.scaleUp(width, zoom);
height = DPIUtil.scaleUp(height, zoom);
scrollInPixels(destX, destY, x, y, width, height, all);
Rectangle rect = DPIUtil.scaleUp(new Rectangle(x, y, width, height), zoom);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: at all other places the variable is called rectangle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adapted it 👍

This commit unifies scale up results in different places. With zoom
values not dividable by 100 scaling up via rectangle or scaling
up all values separately can give different result.
Scaling always as rectangle solves this limitation.
@akoch-yatta
Copy link
Contributor Author

Changes looks sound to me. I was only wondering about whether scaling destination coordinates independently is correct, but found that to be fine (in particular since source x/y are only used for "correcting" width/height).

Yes, from the usages I found this the correct/best solution

@HeikoKlare HeikoKlare merged commit bd3357c into eclipse-platform:master Feb 1, 2025
14 checks passed
@HeikoKlare HeikoKlare deleted the fix-scaling-bounds branch February 1, 2025 19:18
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