Changeset 16997 in josm for trunk/src/org
- Timestamp:
- 2020-09-02T19:58:37+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r16988 r16997 1490 1490 return null; 1491 1491 } 1492 if (resizeMode == ImageResizeMode.BOUNDED) { 1493 resizeMode = ImageResizeMode.BOUNDED_UPSCALE; 1494 } 1492 1495 return resizeMode.createBufferedImage(dim, new Dimension((int) sourceWidth, (int) sourceHeight), g -> { 1493 1496 try { -
trunk/src/org/openstreetmap/josm/tools/ImageResizeMode.java
r16978 r16997 33 33 @Override 34 34 Dimension computeDimension(Dimension dim, Dimension icon) { 35 final int maxWidth = Math.min(dim.width, icon.width); 36 final int maxHeight = Math.min(dim.height, icon.height); 37 return BOUNDED_UPSCALE.computeDimension(new Dimension(maxWidth, maxHeight), icon); 38 } 39 }, 40 41 BOUNDED_UPSCALE { 42 @Override 43 Dimension computeDimension(Dimension dim, Dimension icon) { 35 44 CheckParameterUtil.ensureThat((dim.width > 0 || dim.width == -1) && (dim.height > 0 || dim.height == -1), 36 45 () -> dim + " is invalid"); 37 final int maxWidth = Math.min(dim.width, icon.width);38 final int maxHeight = Math.min(dim.height, icon.height);46 final int maxWidth = dim.width; 47 final int maxHeight = dim.height; 39 48 final Dimension spec; 40 49 if (maxWidth == -1 || maxHeight == -1) {
Note:
See TracChangeset
for help on using the changeset viewer.