Changeset 17144 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2020-10-10T18:41:23+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
r16252 r17144 190 190 img = noIcon == null ? null : noIcon.getImage(); 191 191 } else { 192 img = rescale(result.getImageIcon(new Dimension(width, height)).getImage()); 192 img = result.getImageIcon(new Dimension(width, height)).getImage(); 193 if (img != null && mustRescale(img)) { 194 // Scale down large images to 16x16 pixels if no size is explicitly specified 195 img = result.getImageIconBounded(ImageProvider.ImageSizes.MAP.getImageDimension()).getImage(); 196 } 193 197 } 194 198 if (temporary) { … … 301 305 } 302 306 303 /**304 * Rescale excessively large images.305 * @param image the unscaled image306 * @return The scaled down version to 16x16 pixels if the image height and width exceeds 48 pixels and no size has been explicitly specified307 */308 private Image rescale(Image image) {309 if (image == null) return null;310 // Scale down large (.svg) images to 16x16 pixels if no size is explicitly specified311 if (mustRescale(image)) {312 return ImageProvider.createBoundedImage(image, 16);313 } else {314 return image;315 }316 }317 318 307 private boolean mustRescale(Image image) { 319 308 return autoRescale && width == -1 && image.getWidth(null) > MAX_SIZE
Note:
See TracChangeset
for help on using the changeset viewer.