Changeset 10965 in josm for trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
- Timestamp:
- 2016-09-05T23:50:16+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r10925 r10965 550 550 * Zoom to the given coordinate and scale. 551 551 * 552 * @param newCenter The center x-value (easting) to zoom to.553 * @param newScale The scale to use.552 * @param center The center x-value (easting) to zoom to. 553 * @param scale The scale to use. 554 554 * @param initial true if this call initializes the viewport. 555 555 */ 556 public void zoomTo(EastNorth newCenter, double newScale, boolean initial) {556 public void zoomTo(EastNorth center, double scale, boolean initial) { 557 557 Bounds b = getProjection().getWorldBoundsLatLon(); 558 558 ProjectionBounds pb = getProjection().getWorldBoundsBoxEastNorth(); 559 double newScale = scale; 559 560 int width = getWidth(); 560 561 int height = getHeight(); 561 562 562 563 // make sure, the center of the screen is within projection bounds 563 double east = newCenter.east();564 double north = newCenter.north();564 double east = center.east(); 565 double north = center.north(); 565 566 east = Math.max(east, pb.minEast); 566 567 east = Math.min(east, pb.maxEast); 567 568 north = Math.max(north, pb.minNorth); 568 569 north = Math.min(north, pb.maxNorth); 569 newCenter = new EastNorth(east, north);570 EastNorth newCenter = new EastNorth(east, north); 570 571 571 572 // don't zoom out too much, the world bounds should be at least
Note:
See TracChangeset
for help on using the changeset viewer.