diff --git a/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java b/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java index ea39eba063..92d16c1ed1 100644 --- a/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java +++ b/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java @@ -1249,7 +1249,13 @@ public void selectionChanged(SelectionChangeEvent event) { } private void resetTiles(Collection primitives) { - if (primitives.size() >= this.data.allNonDeletedCompletePrimitives().size() || primitives.size() > 100) { + // Clear the cache if we aren't using tiles. And return. + if (!MapRendererFactory.getInstance().isMapRendererActive(StyledTiledMapRenderer.class)) { + this.cache.clear(); + return; + } + // Don't use anything that uses filtered collections. It becomes slow at large datasets. + if (primitives.size() > 100) { dirtyAll(); return; }