Ignore:
Timestamp:
2014-05-02T18:14:52+02:00 (10 years ago)
Author:
bastiK
Message:

fixed #9669 - key-press 3 on node goes down to 6 meter

new advanced property zoom_to_selection_min_size_in_meter to
set the minimum width and height of the area (in meter) for the
zoom to selection action "3"

File:
1 edited

Legend:

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

    r6623 r7053  
    163163    /**
    164164     * Specify a degree larger than 0 in order to make the bounding box at least
    165      * the specified amount of degrees high and wide. The value is ignored if the
     165     * the specified size in width and height. The value is ignored if the
    166166     * bounding box is already larger than the specified amount.
    167167     *
     
    172172     * will be centered within the new bounding box.
    173173     *
    174      * @param minDegrees
     174     * @param size minimum width and height in meter
    175175     */
    176     public void enlargeToMinDegrees(double minDegrees) {
     176    public void enlargeToMinSize(double size) {
    177177        if (bounds == null)
    178178            return;
    179 
    180         EastNorth minEnlarge = Main.getProjection().latlon2eastNorth(new LatLon(0, minDegrees));
    181 
    182         visit(bounds.getMin().add(-minEnlarge.east()/2, -minEnlarge.north()/2));
    183         visit(bounds.getMax().add(+minEnlarge.east()/2, +minEnlarge.north()/2));
     179        // convert size from meters to east/north units
     180        double en_size = size * Main.map.mapView.getScale() / Main.map.mapView.getDist100Pixel() * 100;
     181        visit(bounds.getMin().add(-en_size/2, -en_size/2));
     182        visit(bounds.getMax().add(+en_size/2, +en_size/2));
    184183    }
    185184
Note: See TracChangeset for help on using the changeset viewer.