Skip to content

[Refactor DPIUtil] rename scaleUp/Down #2314

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

ShahzaibIbrahim
Copy link
Contributor

Renaming scaleDown and ScaleUp methods to pixelToPoint and pointToPixel respectively. The implementation detail (using a scale factor in body) doesn't clearly convey the intent of the method from its name. When someone (me) reads scaleDown(x) or scaleUp(x), the natural question is:

“Scaling relative to what? What coordinate system or unit is this about?”

That’s ambiguous without diving into the implementation.
In contrast, renaming to pixelToPoint(x) and pointToPixel(x) makes it immediately clear. We’re converting between pixel units (physical/screen space) and point units (logical/UI space). The direction of conversion is unambiguous.

The changes are done with Eclipse Refactoring tool. There are no manual changes.

renaming scaleDown and ScaleUp methods to pixelToPoint and pointToPixel
respectively
Copy link
Contributor

Test Results

   546 files  ±0     546 suites  ±0   30m 6s ⏱️ - 9m 48s
 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 04b2817. ± Comparison against base commit f8c19db.

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review July 14, 2025 12:01
@arunjose696
Copy link
Contributor

I tested the refactorings locally, and the changes look good to me.

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.

[Refactor DPIUtil] rename scaleDown and ScaleUp methods to pixelToPoint and pointToPixel respectively
2 participants