Skip to content
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

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,15 @@ public Image getImage() {
return createImage();
}

/**
* Returns an SWT Image that is described by the information in this descriptor.
* Each call returns a new Image.
*/
@Override
public ImageData getImageData() {
ImageData data = null;
ImageData defaultImage = WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData();
if (defaultImage == null) {
return null;
public ImageData getImageData(int zoom) {
if (program != null) {
ImageData imageData = program.getImageData(zoom);
if (imageData != null) {
return imageData;
}
}

if (program == null || ((data = program.getImageData()) == null)) {
return defaultImage;
}

// 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;
}
Comment on lines -81 to -85
Copy link
Contributor

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:
image
image
Since the code has been introduced more than 20 yeras ago, it was probably some problem with GNOME environments back then.


return data;
return WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData(zoom);
}

/**
Expand Down
Loading