Ignore:
Timestamp:
2010-04-29T17:15:09+02:00 (14 years ago)
Author:
dhansen
Message:

Fix autozoom fight when windows are really small.

The tile set size and the pixelation autozoom code are fighting.
This happens when the window is less than one tile wide.

See the comment for a bit more of a description. This is just a workaround.

File:
1 edited

Legend:

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

    r19070 r21021  
    802802    }
    803803
     804    boolean az_disable = false;
    804805    boolean autoZoomEnabled()
    805806    {
     807        if (az_disable)
     808            return false;
    806809        return autoZoomPopup.isSelected();
    807810    }
     
    852855                    out("too zoomed in, (" + ts.tilesSpanned()
    853856                        + "), increasing zoom from " + currentZoomLevel);
     857                // This is a hack.  ts.tooSmall() is proabably a bad thing, and this works
     858                // around it.  If we have a very small window, the tileSet may be well
     859                // less than 1 real tile wide, but that's expected.  But, this sees the
     860                // tile set as too small and zooms in.  The code below that checks for
     861                // pixel stretching disagrees and tries to zoom out.  Both calls recurse,
     862                // hillarity ensues, and the stack overflows.
     863                //
     864                // This really needs to get fixed properly.  We probably shouldn't even
     865                // have the tooSmall() check on tileSets.  But, this also helps the zoom
     866                // converge to the correct place much faster.
     867                boolean tmp = az_disable;
     868                az_disable = true;
    854869                if (increaseZoomLevel())
    855870                     this.paint(oldg, mv, bounds);
     871                az_disable = tmp;
    856872                return;
    857873            }
Note: See TracChangeset for help on using the changeset viewer.