- Timestamp:
- 2014-05-02T18:14:52+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r7012 r7053 251 251 // Increase the bounding box by up to 100% to give more context. 252 252 v.enlargeBoundingBoxLogarithmically(100); 253 // Make the bounding box at least 0.0005 degrees (≈ 56 m)wide to253 // Make the bounding box at least 100 meter wide to 254 254 // ensure reasonable zoom level when zooming onto single nodes. 255 v.enlargeToMin Degrees(0.0005);255 v.enlargeToMinSize(Main.pref.getDouble("zoom_to_selection_min_size_in_meter", 100)); 256 256 break; 257 257 case "download": -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r6623 r7053 163 163 /** 164 164 * 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 the165 * the specified size in width and height. The value is ignored if the 166 166 * bounding box is already larger than the specified amount. 167 167 * … … 172 172 * will be centered within the new bounding box. 173 173 * 174 * @param minDegrees174 * @param size minimum width and height in meter 175 175 */ 176 public void enlargeToMin Degrees(double minDegrees) {176 public void enlargeToMinSize(double size) { 177 177 if (bounds == null) 178 178 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)); 184 183 } 185 184
Note:
See TracChangeset
for help on using the changeset viewer.