Ticket #14562: 14562.patch

File 14562.patch, 1.8 KB (added by wiktorn, 5 months ago)
  • src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    commit 2df7b608f9f5f394018e375906da2d79b9da7a6f
    Author: Wiktor Niesiobędzki <github@vink.pl>
    Date:   Mon May 28 00:00:15 2018 +0200
    
        Fix not using tiles from lower zoom levels
    
    diff --git src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
    index cc11c0918..176d0ceb9 100644
    implements ImageObserver, TileLoaderListener, ZoomChangeListener, FilterChangeLi 
    15561556                TileSet ts2 = new TileSet(tileSource.getCoveringTileRange(missed, newzoom));
    15571557                // Instantiating large TileSets is expensive. If there are no loaded tiles, don't bother even trying.
    15581558                if (ts2.allLoadedTiles().isEmpty()) {
    1559                     newlyMissedTiles.add(missed);
    1560                     continue;
     1559                    if (zoomOffset > 0) {
     1560                        newlyMissedTiles.add(missed);
     1561                        continue;
     1562                    } else {
     1563                        /*
     1564                         *  We have negative zoom offset. Try to load tiles from lower zoom levels, as they may be not present
     1565                         *  in tile cache (e.g. when user panned the map or opened layer above zoom level, for which tiles are present.
     1566                         *  This will ensure, that tileCache is populated with tiles from lower zoom levels so it will be possible to
     1567                         *  use them to paint overzoomed tiles.
     1568                         *  See: #14562
     1569                         */
     1570                        ts2.loadAllTiles(false);
     1571                    }
    15611572                }
    15621573                if (ts2.tooLarge()) {
    15631574                    continue;