Skip to content

Conversation

@arunjose696
Copy link
Contributor

@arunjose696 arunjose696 commented Aug 1, 2025

This issue reverts the behavior of GC::textExtent to use GC::getZoom() instead of the font’s zoom, as the previous change(#2306) introduced a regression.

I am yet unable to identify the root cause of the regression. From my understanding, With a monitor zoom of 150 even in the case of Integer200, the text when drawn with OS.DrawText is drawn according to monitor zoom (e.g., 150), which aligns with gc.font.zoom. Based on this, it seemed reasonable to use the font’s zoom to calculate the text extent as gc.textExtent() works by drawing text in pixels with OS.drawText() and therefore should convert pixels to points using the zoom the text was drawn with.

However, since the change causes a regression which makes eclipse almost unsusable at Integer200, this PR reverts the behavior to its previous state for the M3 release. A more detailed investigation needs to be conducted separately.

Fixes #2361.

Reopens #2311.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2025

Test Results

   546 files  ±0     546 suites  ±0   30m 21s ⏱️ + 1m 12s
 4 425 tests ±0   4 408 ✅ ±0   17 💤 ±0  0 ❌ ±0 
16 746 runs  ±0  16 619 ✅ ±0  127 💤 ±0  0 ❌ ±0 

Results for commit ba12ac5. ± Comparison against base commit 540a1d7.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare marked this pull request as ready for review August 11, 2025 08:26
@HeikoKlare HeikoKlare force-pushed the arunjose696/383/revertTextExtent branch from 096b0df to 9b884da Compare August 11, 2025 08:26
@arunjose696 arunjose696 force-pushed the arunjose696/383/revertTextExtent branch 2 times, most recently from e92a164 to b3df19b Compare August 11, 2025 08:33
This issue reverts the behavior of GC::textExtent to use the
GC::getZoom() instead of the zoom from the font as this results in a
regression.

Fixes eclipse-platform#2361
@HeikoKlare HeikoKlare force-pushed the arunjose696/383/revertTextExtent branch from b3df19b to ba12ac5 Compare August 11, 2025 08:53
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.

The revert properly fixes the regression for the swt.autoScale=int200 scenario. It will reintroduce the issue reported with:

That issue will be resolved in a different way.

@HeikoKlare HeikoKlare merged commit e2ac7f1 into eclipse-platform:master Aug 11, 2025
17 checks passed
@HeikoKlare HeikoKlare deleted the arunjose696/383/revertTextExtent branch August 11, 2025 09:36
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.

Wrong text extent calculation with swt.autoScale=int200 [Win32] Wrong text extent calculation with swt.autoScale=int200

2 participants