Skip to content

Reintroduce scaling methods for Rectangle #2295

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amartya4256
Copy link
Contributor

@amartya4256 amartya4256 commented Jul 9, 2025

This commit reintroduces scaling methods for plain Rectangle to provide backwards compatibility to the consumers which explicitly create a Rectangle and want to call scaleBounds or scaleUp/scaleDown since they have different behaviour and Rectangle.OfFloat unifies this.

Note: The values in the tests are changed to 83 even though 82 is the right value. It is because having called DPIUtil:scaleUp/scaleBounds with Rectangle has not so precise result as compared to Rectangle.OfFloat. The test tests a regular rectangle and ofcourse a test with Rectangle.OfFloat will lead to 82 as the expected value.

Copy link
Contributor

github-actions bot commented Jul 9, 2025

Test Results

   546 files  ±0     546 suites  ±0   32m 20s ⏱️ + 1m 19s
 4 407 tests ±0   4 390 ✅ ±0   17 💤 ±0  0 ❌ ±0 
16 713 runs  ±0  16 586 ✅ ±0  127 💤 ±0  0 ❌ ±0 

Results for commit e15f549. ± Comparison against base commit 95b46b6.

♻️ This comment has been updated with latest results.

@amartya4256 amartya4256 marked this pull request as ready for review July 10, 2025 11:17
@amartya4256 amartya4256 force-pushed the amartya4256/dpiUtils_old_introduce branch 2 times, most recently from 18f05c0 to f19d02a Compare July 10, 2025 11:42
@amartya4256 amartya4256 force-pushed the amartya4256/dpiUtils_old_introduce branch 2 times, most recently from 52ea386 to e5a22c3 Compare July 16, 2025 13:01
@amartya4256 amartya4256 force-pushed the amartya4256/dpiUtils_old_introduce branch 2 times, most recently from 91848c1 to 3ad107b Compare July 17, 2025 08:01
This commit reintroduces scaling methods for plain Rectangle & Point to provide
backwards compatibility to the consumers which explicitly create a
Rectangle & Point and want to call scaleBounds or scaleUp/scaleDown since they
have different behaviour and Rectangle.OfFloat unifies this.
@amartya4256 amartya4256 force-pushed the amartya4256/dpiUtils_old_introduce branch from 3ad107b to e15f549 Compare July 17, 2025 08:50
Copy link
Contributor

@ShahzaibIbrahim ShahzaibIbrahim left a comment

Choose a reason for hiding this comment

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

I have tested it with following configuration:

-Dswt.autoScale=quarter
-Dswt.autoScale.updateOnRuntime=true

With zoom of 175% primary monitor:

No Selection:

image

All Text Selected:

image

I don't see any artifact lines anymore. Hence, approving it.

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.

Regression: StyledText reintroduces artifact line while rendering
2 participants