Ignore:
Timestamp:
2009-07-12T20:25:26+02:00 (15 years ago)
Author:
dhansen
Message:

This makes sure that we don't get into any zooming loops.
We only recursively call to repaint when we've actually
changed zoom level, just just when we've attempted to
change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java

    r16457 r16458  
    577577                if (ts.tilesSpanned() > (18*18)) {
    578578                        System.out.println("too many tiles, decreasing zoom from " + currentZoomLevel);
    579                         if (decreaseZoomLevel()) {
     579            if (decreaseZoomLevel())
    580580                                this.paint(oldg, mv);
    581                         }
    582                         return;
    583                 }//end of if more than 18*18
     581            return;
     582            }
    584583               
    585584                if (ts.tilesSpanned() <= 0) {
    586585                        System.out.println("doesn't even cover one tile, increasing zoom from " + currentZoomLevel);
    587                         if (increaseZoomLevel()) {
    588                                 this.paint(oldg, mv);
    589                         }
    590                         return;
    591                 }
     586            if (increaseZoomLevel())
     587                 this.paint(oldg, mv);
     588            return;
     589        }
    592590
    593591                int fontHeight = g.getFontMetrics().getHeight();
Note: See TracChangeset for help on using the changeset viewer.