Changeset 1662 in josm


Ignore:
Timestamp:
2009-06-10T18:01:55+02:00 (15 years ago)
Author:
stoecker
Message:

fix #2344 - zooming to single GPS point

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r1302 r1662  
    9797                    double maxlat = Double.parseDouble(bounds[2]);
    9898                    double maxlon = Double.parseDouble(bounds[3]);
    99                    
     99
    100100                    v.visit(Main.proj.latlon2eastNorth(new LatLon(minlat, minlon)));
    101101                    v.visit(Main.proj.latlon2eastNorth(new LatLon(maxlat, maxlon)));
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r1518 r1662  
    318318        double oldScale = this.scale;
    319319
    320         if (box == null || box.min == null || box.max == null || box.min.equals(box.max)) {
     320        if (box == null || box.min == null || box.max == null) {
    321321            // no bounds means whole world
    322322            center = getProjection().latlon2eastNorth(new LatLon(0,0));
     
    326326            scale = Math.max(scaleX, scaleY); // minimum scale to see all of the screen
    327327        } else {
     328            if(box.min.equals(box.max))
     329                box.enlargeBoundingBox();
    328330            center = new EastNorth(box.min.east()/2+box.max.east()/2, box.min.north()/2+box.max.north()/2);
    329331            double scaleX = (box.max.east()-box.min.east())/w;
     
    365367                l.activeLayerChange(old, layer);
    366368        }
    367        
     369
    368370        /* This only makes the buttons look disabled. Disabling the actions as well requires
    369371         * the user to re-select the tool after i.e. moving a layer. While testing I found
Note: See TracChangeset for help on using the changeset viewer.