Changeset 4329 in josm


Ignore:
Timestamp:
Aug 21, 2011 5:45:53 PM (21 months ago)
Author:
hansendc
Message:

fix map flicker in TMSLayer drawing code when zooming out

I'm seeing the map flicker and black-out during zoom-out operations. It
only seems to happen when I _start_ zoomed in to an area. I believe
it's because there are no visible tiles in upper zoom levels and
displayZoomLevel gets set to 2 when the while loop goes a bit nuts.
Thus, no tiles get drawn since it's so far away from my actual zoom
level and it takes a moment for repaint to get called.

This patch will not bother moving displayZoomLevel unless we've
unquestionably _found_ some more visible tiles in another zoom level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r4328 r4329  
    11661166            } 
    11671167            // Find highest zoom level with at least one visible tile 
    1168             while (displayZoomLevel > dts.minZoom && 
    1169                     !dts.getTileSetInfo(displayZoomLevel).hasVisibleTiles) { 
    1170                 displayZoomLevel--; 
     1168            for (int tmpZoom = zoom; tmpZoom > dts.minZoom; tmpZoom--) { 
     1169                if (dts.getTileSetInfo(tmpZoom).hasVisibleTiles) { 
     1170                    displayZoomLevel = tmpZoom; 
     1171                    break; 
     1172                } 
    11711173            } 
    11721174            // Do binary search between currentZoomLevel and displayZoomLevel 
Note: See TracChangeset for help on using the changeset viewer.