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   33m 15s ⏱️ - 6m 39s
 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 52ea386. ± Comparison against base commit f8c19db.

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

# Conflicts:
#	bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java
#	tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/DPIUtilTests.java
@amartya4256 amartya4256 force-pushed the amartya4256/dpiUtils_old_introduce branch from f19d02a to 52ea386 Compare July 14, 2025 10:09
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.

1 participant