Skip to content

[MacOS] Fix width/height of Images created via ImageGcDrawer #1751

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

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

HeikoKlare
Copy link
Contributor

The current implementation of the Image constructor accepting an ImageGcDrawer does initialize the image with the given width and height but extracts them from the image data being initialized with the ImageGcDrawer. This does not take the current device zoom into account properly, leading to images unexpectedly being rendered for 100% scaling while they are supposed to be used at 200% scaling.

With this change, images are properly initialized with the given width and height and using the according device zoom for the image data generation, leading to a sharp initialization also on 200% monitors.

Serves as a fix for the MacOS part of issue eclipse-platform/eclipse.platform.ui#2740

Before fix

linenumberruler_macos_before.mov

After fix

linenumberruler_macos_after.mov

The current implementation of the Image constructor accepting an
ImageGcDrawer does initialize the image with the given width and height
but extracts them from the image data being initialized with the
ImageGcDrawer. This does not take the current device zoom into account
properly, leading to images unexpectedly being rendered for 100% scaling
while they are supposed to be used at 200% scaling.

With this change, images are properly initialized with the given width
and height and using the according device zoom for the image data
generation, leading to a sharp initialization also on 200% monitors.

Serves as a fix for the MacOS part of issue
eclipse-platform/eclipse.platform.ui#2740
@HeikoKlare
Copy link
Contributor Author

@BeckerWdf may I ask you to test if this fixes the issue you reported in eclipse-platform/eclipse.platform.ui#2740 for you as well?

@HeikoKlare HeikoKlare marked this pull request as ready for review January 22, 2025 10:33
Copy link
Contributor

Test Results

   494 files  ±0     494 suites  ±0   9m 33s ⏱️ - 1m 9s
 4 330 tests ±0   4 317 ✅ ±0   13 💤 ±0  0 ❌ ±0 
16 568 runs  ±0  16 460 ✅ ±0  108 💤 ±0  0 ❌ ±0 

Results for commit 8ea0280. ± Comparison against base commit ffa1084.

@BeckerWdf
Copy link
Contributor

@BeckerWdf may I ask you to test if this fixes the issue you reported in eclipse-platform/eclipse.platform.ui#2740 for you as well?

Just tested it. With this PR the issues are gone.

@HeikoKlare
Copy link
Contributor Author

Thank you for testing, @BeckerWdf!

@HeikoKlare HeikoKlare merged commit 60ef7e9 into eclipse-platform:master Jan 22, 2025
14 checks passed
@HeikoKlare HeikoKlare deleted the issue-ui-2740-macos branch January 22, 2025 13:11
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.

2 participants