Changeset 6290 in josm


Ignore:
Timestamp:
2013-10-03T23:58:56+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #9155 - map style icon resizing tries to make zero height icons sometimes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r6160 r6290  
    7171            ImageIcon icon = new ImageIcon(base);
    7272            if (width == -1) {
    73                 width = icon.getIconWidth() * height / icon.getIconHeight();
     73                width = Math.max(1, icon.getIconWidth() * height / icon.getIconHeight());
    7474            } else if (height == -1) {
    75                 height = icon.getIconHeight() * width / icon.getIconWidth();
     75                height = Math.max(1, icon.getIconHeight() * width / icon.getIconWidth());
    7676            }
    7777            Image i = icon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH);
Note: See TracChangeset for help on using the changeset viewer.