- Timestamp:
- 2020-08-21T23:25:39+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
r15046 r16900 55 55 if (r.width >= 3 && r.height >= 3 && MainApplication.isDisplayingMapView()) { 56 56 MapView mv = MainApplication.getMap().mapView; 57 mv.zoomToFactor(mv.getEastNorth(r.x+r.width/2, r.y+r.height/2), r.getWidth()/mv.getWidth()); 57 final double factor; 58 if (r.x == e.getPoint().x || r.y == e.getPoint().y) { 59 factor = mv.getWidth() / r.getWidth(); // zoom out 60 } else { 61 factor = r.getWidth() / mv.getWidth(); // zoom in 62 } 63 mv.zoomToFactor(mv.getEastNorth(r.x + r.width / 2, r.y + r.height / 2), factor); 58 64 } 59 65 }
Note:
See TracChangeset
for help on using the changeset viewer.