Ignore:
Timestamp:
2018-02-12T23:19:49+01:00 (6 years ago)
Author:
bastiK
Message:

fixed #11607 - RangeViolatedError: the new range must be within a single subrange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r13104 r13420  
    1919import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon;
    2020import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache;
     21import org.openstreetmap.josm.gui.MainApplication;
    2122import org.openstreetmap.josm.gui.NavigatableComponent;
     23import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2224import org.openstreetmap.josm.gui.mappaint.DividedScale.RangeViolatedError;
    2325import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
     
    9092            preferenceCache.clear();
    9193            backgroundColorCache = null;
     94            MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class).forEach(
     95                    dl -> dl.data.clearMappaintCache());
    9296        });
    9397    }
     
    139143     */
    140144    public Pair<StyleElementList, Range> getStyleCacheWithRange(OsmPrimitive osm, double scale, NavigatableComponent nc) {
    141         if (osm.mappaintStyle == null || osm.getMappaintCacheIdx() != cacheIdx || scale <= 0) {
     145        if (!osm.isCachedStyleUpToDate() || scale <= 0) {
    142146            osm.mappaintStyle = StyleCache.EMPTY_STYLECACHE;
    143147        } else {
     
    195199                    + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e);
    196200        }
    197         osm.setMappaintCacheIdx(cacheIdx);
     201        osm.declareCachedStyleUpToDate();
    198202        return p;
    199203    }
Note: See TracChangeset for help on using the changeset viewer.