Changeset 14734 in josm for trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
- Timestamp:
- 2019-01-26T09:07:58+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r14628 r14734 164 164 BoundingXYVisitor bboxCalculator = new BoundingXYVisitor(); 165 165 bboxCalculator.computeBoundingBox(sel); 166 // increase bbox. This is required167 // especially if the bbox contains one single node, but helpful168 // in most other cases as well.169 bboxCalculator.enlargeBoundingBox();170 166 if (bboxCalculator.getBounds() != null) { 171 167 MainApplication.getMap().mapView.zoomTo(bboxCalculator); … … 396 392 } 397 393 398 // Do not zoom if the current scale covers the selection, #16706 399 final MapView mapView = MainApplication.getMap().mapView; 400 final double mapScale = mapView.getScale(); 401 final double minScale = v.getBounds().getScale(mapView.getWidth(), mapView.getHeight()); 402 v.enlargeBoundingBoxLogarithmically(); 403 final double maxScale = v.getBounds().getScale(mapView.getWidth(), mapView.getHeight()); 404 if (minScale <= mapScale && mapScale < maxScale) { 405 mapView.zoomTo(v.getBounds().getCenter()); 406 } else { 407 mapView.zoomTo(v); 408 } 394 MainApplication.getMap().mapView.zoomTo(v); 409 395 } 410 396
Note:
See TracChangeset
for help on using the changeset viewer.