Skip to content

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
@github-actions
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.

@fedejeanne fedejeanne merged commit 95b46b6 into eclipse-platform:master Jul 15, 2025
17 checks passed
@fedejeanne fedejeanne deleted the master-353 branch July 15, 2025 07:53
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

3 participants