Changeset 1226 in josm


Ignore:
Timestamp:
2009-01-09T21:36:04+01:00 (16 years ago)
Author:
stoecker
Message:

fixed bug #1963, fix by markb _ ordern _ com

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java

    r1169 r1226  
    55import org.openstreetmap.josm.data.Bounds;
    66import org.openstreetmap.josm.data.coor.EastNorth;
     7import org.openstreetmap.josm.data.coor.LatLon;
    78import org.openstreetmap.josm.data.osm.Node;
    89import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    6162
    6263    /**
    63      * Enlarges the calculated bounding box by 0.0001 degrees.
     64     * Enlarges the calculated bounding box by 0.002 degrees.
    6465     * If the bounding box has not been set (<code>min</code> or <code>max</code>
    6566     * equal <code>null</code>) this method does not do anything.
     
    6869     */
    6970    public void enlargeBoundingBox() {
    70         enlargeBoundingBox(0.0001);
     71        enlargeBoundingBox(0.002);
    7172    }
    7273
     
    8182        if (min == null || max == null)
    8283            return;
    83         EastNorth en = new EastNorth(enlargeDegree, enlargeDegree);
    84         min = new EastNorth(min.east() - en.east(), min.north() - en.north());
    85         max = new EastNorth(max.east() + en.east(), max.north() + en.north());
     84        LatLon minLatlon = Main.proj.eastNorth2latlon(min);
     85        min = Main.proj.latlon2eastNorth(new LatLon(minLatlon.lat() - enlargeDegree, minLatlon.lon() - enlargeDegree));
     86        LatLon maxLatlon = Main.proj.eastNorth2latlon(max);
     87        max = Main.proj.latlon2eastNorth(new LatLon(maxLatlon.lat() + enlargeDegree, maxLatlon.lon() + enlargeDegree));
    8688    }
    8789}
Note: See TracChangeset for help on using the changeset viewer.