Changeset 13636 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2018-04-15T18:58:21+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r13420 r13636 105 105 } 106 106 107 /** 108 * Returns the background color. 109 * @return the background color 110 */ 107 111 public Color getBackgroundColor() { 108 112 if (backgroundColorCache != null) … … 144 148 public Pair<StyleElementList, Range> getStyleCacheWithRange(OsmPrimitive osm, double scale, NavigatableComponent nc) { 145 149 if (!osm.isCachedStyleUpToDate() || scale <= 0) { 146 osm. mappaintStyle = StyleCache.EMPTY_STYLECACHE;150 osm.setCachedStyle(StyleCache.EMPTY_STYLECACHE); 147 151 } else { 148 Pair<StyleElementList, Range> lst = osm. mappaintStyle.getWithRange(scale, osm.isSelected());152 Pair<StyleElementList, Range> lst = osm.getCachedStyle().getWithRange(scale, osm.isSelected()); 149 153 if (lst.a != null) 150 154 return lst; … … 191 195 } 192 196 } 193 StyleCache style = osm. mappaintStyle != null ? osm.mappaintStyle: StyleCache.EMPTY_STYLECACHE;197 StyleCache style = osm.getCachedStyle() != null ? osm.getCachedStyle() : StyleCache.EMPTY_STYLECACHE; 194 198 try { 195 osm. mappaintStyle = style.put(p.a, p.b, osm.isSelected());199 osm.setCachedStyle(style.put(p.a, p.b, osm.isSelected())); 196 200 } catch (RangeViolatedError e) { 197 201 throw new AssertionError("Range violated: " + e.getMessage() 198 + " (object: " + osm.getPrimitiveId() + ", current style: "+osm. mappaintStyle202 + " (object: " + osm.getPrimitiveId() + ", current style: "+osm.getCachedStyle() 199 203 + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e); 200 204 } … … 462 466 } 463 467 468 /** 469 * Determines whether multipolygons must be drawn. 470 * @return whether multipolygons must be drawn. 471 */ 464 472 public boolean isDrawMultipolygon() { 465 473 return drawMultipolygon; 466 474 } 467 475 476 /** 477 * Sets whether multipolygons must be drawn. 478 * @param drawMultipolygon whether multipolygons must be drawn 479 */ 468 480 public void setDrawMultipolygon(boolean drawMultipolygon) { 469 481 this.drawMultipolygon = drawMultipolygon;
Note:
See TracChangeset
for help on using the changeset viewer.