Changeset 14331 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-10-14T17:02:51+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r14328 r14331 34 34 import java.util.Base64; 35 35 import java.util.Collection; 36 import java.util.EnumMap; 36 37 import java.util.HashMap; 37 38 import java.util.HashSet; … … 315 316 316 317 /** small cache of critical images used in many parts of the application */ 317 private static final Map<OsmPrimitiveType, ImageIcon> osmPrimitiveTypeCache = new HashMap<>();318 private static final Map<OsmPrimitiveType, ImageIcon> osmPrimitiveTypeCache = new EnumMap<>(OsmPrimitiveType.class); 318 319 319 320 /** larger cache of critical padded image icons used in many parts of the application */ … … 1634 1635 } 1635 1636 1636 if (realWidth == 0 || realHeight == 0) { 1637 int roundedWidth = Math.round(realWidth); 1638 int roundedHeight = Math.round(realHeight); 1639 if (roundedWidth <= 0 || roundedHeight <= 0) { 1640 Logging.error("createImageFromSvg: {0} {1} realWidth={2} realHeight={3}", 1641 svg.getXMLBase(), dim, Float.toString(realWidth), Float.toString(realHeight)); 1637 1642 return null; 1638 1643 } 1639 BufferedImage img = new BufferedImage( Math.round(realWidth), Math.round(realHeight), BufferedImage.TYPE_INT_ARGB);1644 BufferedImage img = new BufferedImage(roundedWidth, roundedHeight, BufferedImage.TYPE_INT_ARGB); 1640 1645 Graphics2D g = img.createGraphics(); 1641 1646 g.setClip(0, 0, img.getWidth(), img.getHeight());
Note:
See TracChangeset
for help on using the changeset viewer.