Changeset 9281 in josm
- Timestamp:
- 2016-01-03T16:51:43+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageResource.java
r9252 r9281 160 160 float realWidth; 161 161 float realHeight; 162 int maxWidth = maxSize.width; 163 int maxHeight = maxSize.height; 162 164 if (svg != null) { 163 165 realWidth = svg.getWidth(); 164 166 realHeight = svg.getHeight(); 165 /* extend small images to the possible maximum, may get reduced later again */166 if (maxSize.width != -1 && realWidth < maxSize.width) {167 realHeight *= maxSize.width/realWidth;168 realWidth = maxSize.width;169 }170 if (maxSize.height != -1 && realHeight < maxSize.height) {171 realWidth *= maxSize.height/realHeight;172 realHeight = maxSize.height;173 }174 167 } else { 175 168 if (baseImage == null) throw new AssertionError(); … … 177 170 realWidth = icon.getIconWidth(); 178 171 realHeight = icon.getIconHeight(); 172 if (realWidth <= maxWidth) { 173 maxWidth = -1; 174 } 175 if (realHeight <= maxHeight) { 176 maxHeight = -1; 177 } 179 178 } 180 int maxWidth = maxSize.width; 181 int maxHeight = maxSize.height; 182 183 if (realWidth <= maxWidth) { 184 maxWidth = -1; 185 } 186 if (realHeight <= maxHeight) { 187 maxHeight = -1; 188 } 189 179 190 180 if (maxWidth == -1 && maxHeight == -1) 191 181 return getImageIcon(DEFAULT_DIMENSION);
Note:
See TracChangeset
for help on using the changeset viewer.