Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

The line height in StyledText is currently too large when the auto-scaled device zoom is larger than the native zoom. This for example happens on a 175% primary monitor with swt.autoScale=int200 or with a fixed swt.autoScale value that is higher than the primary monitor zoom. This was caused by a recent change that accidentally used the auto-scaled zoom instead of the native zoom for retrieving a font handle combined with the general usage of the ScalingSWTFontRegistry that, in comparison to the previous fixed-zoom registry, now returns an accordingly scaled handle.

This change adapts the font handle retrieval to properly pass the native zoom instead of the auto-scaled zoom.

Fixes #2405

Screenshots

Left is before the change, right is after:
image

The line height in StyledText is currently too large when the
auto-scaled device zoom is larger than the native zoom. This for example
happens on a 175% primary monitor with `swt.autoScale=int200` or with a
fixed `swt.autoScale` value that is higher than the primary monitor
zoom. This was caused by a recent change that accidentally used the
auto-scaled zoom instead of the native zoom for retrieving a font handle
combined with the general usage of the ScalingSWTFontRegistry that, in
comparison to the previous fixed-zoom registry, now returns an
accordingly scaled handle.

This change adapts the font handle retrieval to properly pass the native
zoom instead of the auto-scaled zoom.

Fixes eclipse-platform#2405
@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2025

Test Results

   546 files  ±0     546 suites  ±0   29m 22s ⏱️ +13s
 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 0c83576. ± Comparison against base commit e2ac7f1.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

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

Code change made sense as well as why the original change didn't have an effect until recently. I tested with all autoscale mode on 175 and on 150 zoom and didn't find a regression. Good to go from my side

@akoch-yatta akoch-yatta merged commit 2ac9121 into eclipse-platform:master Aug 11, 2025
25 of 27 checks passed
@akoch-yatta akoch-yatta deleted the issue-2405 branch August 11, 2025 11:58
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 line height in StyledText when deviceZoom > nativeZoom [Win32] Wrong line height in StyledText when deviceZoom > nativeZoom

2 participants