-
Notifications
You must be signed in to change notification settings - Fork 193
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
regard external program images if zoom value is > 100% #295
regard external program images if zoom value is > 100% #295
Conversation
71906e5
to
1bc1879
Compare
1bc1879
to
240f6e3
Compare
Can you provide steps to reproduce the issue and to verify the patch? Have you tested it on all 3 supported OSs? |
@lshanmug Would you be able to verify it on macos? |
Sure will test it out today. |
@lshanmug Thanks for testing on macOS. |
@ptief Have you tried the patch on Windows at 200% scaling? Does it render as expected? @mickaelistria Does it render correctly on linux at 100 and 200% scaling with the patch?
AFAICS Program.getImageData() always returns image data (16 x16) for 100% zoom without considering the device scaling. From the Program.getImageData() code, I think this is the same for Windows and Cocoa. |
@lshanmug For win32 and cocoa org.eclipse.swt.program.Program.getImageData() uses the old method for getting the image data org.eclipse.swt.graphics.Image.getImageData() without zoom, which means it uses zoom value 100. I added the zoom support for org.eclipse.swt.program.Program, can you take a look please? |
Creating new API for Program.getImageData(int zoom) looks like the right approach here. |
661155b
to
f7bea05
Compare
I created a PR for SWT and updated this PR with the new API for Program.getImageData(int zoom). |
475a9f0
to
11771e4
Compare
11771e4
to
18d1144
Compare
Test Results 918 files 918 suites 49m 27s ⏱️ Results for commit 5fd4ea5. ♻️ This comment has been updated with latest results. |
// The images in GNOME are too big. Scaling them does not give nice result so | ||
// return defaultImage; | ||
if (data.height > defaultImage.height || data.width > defaultImage.width) { | ||
return defaultImage; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified that completely removing this fallback behavior for GNOME does not produce any regressions. My environment uses GNOME version 42.9.
Result: External program images look exactly the same with and without this code on GNOME. Here are example screenshots for 100% and 200% scaling, which are exactly the same with and without that code:
Since the code has been introduced more than 20 yeras ago, it was probably some problem with GNOME environments back then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good and have been tested in combination with eclipse-platform/eclipse.platform.swt#409.
This should be merged right after eclipse-platform/eclipse.platform.swt#409
2178c04
to
67d53d4
Compare
@ptief can you please squash the three commits into a single one and add a short description according to https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#commit-message-recommendations to the commit message? |
67d53d4
to
229a53e
Compare
229a53e
to
04cdd39
Compare
add support for zoom level of program images
04cdd39
to
5fd4ea5
Compare
If scaling is >100% the external program image should be used - currently it always uses the default object file image if the external program images is bigger than the default image with 100% scale.