Skip to content

Commit

Permalink
regard external program images if zoom value is > 100% and removed
Browse files Browse the repository at this point in the history
deprecated method

Signed-off-by: ptief <[email protected]>
  • Loading branch information
ptief authored and vikapte committed Aug 25, 2022
1 parent aeb1ca4 commit 71906e5
Showing 1 changed file with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,12 @@ 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 && program.getImageData() != null) {
return program.getImageData();
}

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;
}

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

/**
Expand Down

0 comments on commit 71906e5

Please sign in to comment.