Changeset 8289 in josm
- Timestamp:
- 2015-04-28T13:04:18+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r8085 r8289 41 41 IconReference iconRef = c.get(FILL_IMAGE, null, IconReference.class); 42 42 if (iconRef != null) { 43 fillImage = new MapImage(iconRef.iconName, iconRef.source );43 fillImage = new MapImage(iconRef.iconName, iconRef.source, false); 44 44 45 45 color = new Color(fillImage.getImage(false).getRGB( -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapImage.java
r8103 r8289 33 33 public String name; 34 34 public StyleSource source; 35 public boolean autoRescale; 35 36 public int width = -1; 36 37 public int height = -1; … … 42 43 43 44 public MapImage(String name, StyleSource source) { 45 this(name, source, true); 46 } 47 48 public MapImage(String name, StyleSource source, boolean autoRescale) { 44 49 this.name = name; 45 50 this.source = source; 51 this.autoRescale = autoRescale; 46 52 } 47 53 … … 199 205 200 206 private boolean mustRescale(Image image) { 201 return ((width == -1 && image.getWidth(null) > MAX_SIZE)202 && (height == -1 && image.getHeight(null) > MAX_SIZE));207 return autoRescale && width == -1 && image.getWidth(null) > MAX_SIZE 208 && height == -1 && image.getHeight(null) > MAX_SIZE; 203 209 } 204 210 … … 212 218 Objects.equals(name, other.name) && 213 219 Objects.equals(source, other.source) && 220 autoRescale == other.autoRescale && 214 221 width == other.width && 215 222 height == other.height; … … 222 229 hash = 67 * hash + name.hashCode(); 223 230 hash = 67 * hash + source.hashCode(); 231 hash = 67 * hash + (autoRescale ? 1 : 0); 224 232 hash = 67 * hash + width; 225 233 hash = 67 * hash + height;
Note:
See TracChangeset
for help on using the changeset viewer.