Changeset 10458 in josm for trunk/src/org/openstreetmap/josm/gui/MapViewState.java
- Timestamp:
- 2016-06-22T22:18:24+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapViewState.java
r10399 r10458 4 4 import java.awt.Container; 5 5 import java.awt.Point; 6 import java.awt.Rectangle; 6 7 import java.awt.geom.AffineTransform; 7 8 import java.awt.geom.Point2D; … … 135 136 136 137 /** 138 * Gets a rectangle of the view as map view area. 139 * @param rectangle The rectangle to get. 140 * @return The view area. 141 * @since 10458 142 */ 143 public MapViewRectangle getViewArea(Rectangle rectangle) { 144 return getForView(rectangle.getMinX(), rectangle.getMinY()).rectTo(getForView(rectangle.getMaxX(), rectangle.getMaxY())); 145 } 146 147 /** 137 148 * Gets the center of the view. 138 149 * @return The center position. … … 194 205 public MapViewState movedTo(MapViewPoint mapViewPoint, EastNorth newEastNorthThere) { 195 206 EastNorth delta = newEastNorthThere.subtract(mapViewPoint.getEastNorth()); 196 if (delta.distanceSq(0, 0) < . 000001) {207 if (delta.distanceSq(0, 0) < .1e-20) { 197 208 return this; 198 209 } else { … … 397 408 * Gets a rough estimate of the bounds by assuming lat/lon are parallel to x/y. 398 409 * @return The bounds computed by converting the corners of this rectangle. 410 * @see #getLatLonBoundsBox() 399 411 */ 400 412 public Bounds getCornerBounds() { … … 403 415 return b; 404 416 } 417 418 /** 419 * Gets the real bounds that enclose this rectangle. 420 * This is computed respecting that the borders of this rectangle may not be a straignt line in latlon coordinates. 421 * @return The bounds. 422 * @since 10458 423 */ 424 public Bounds getLatLonBoundsBox() { 425 return projection.getLatLonBoundsBox(getProjectionBounds()); 426 } 405 427 } 406 428
Note:
See TracChangeset
for help on using the changeset viewer.