mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
Jupyter: improve image panel
This commit is contained in:
@@ -49,7 +49,13 @@ public class IpnbImagePanel extends IpnbCodeOutputPanel<IpnbImageOutputCell> {
|
||||
public void paintComponent(Graphics g) {
|
||||
final Icon icon = getIcon();
|
||||
if (icon instanceof ImageIcon) {
|
||||
g.drawImage(((ImageIcon)icon).getImage(), 0, 0, getWidth(), getHeight(), this);
|
||||
final Image image = ((ImageIcon)icon).getImage();
|
||||
if (getWidth() < image.getWidth(null)) {
|
||||
g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
|
||||
}
|
||||
else {
|
||||
super.paintComponent(g);
|
||||
}
|
||||
}
|
||||
else {
|
||||
super.paintComponent(g);
|
||||
|
||||
Reference in New Issue
Block a user