Ignore:
Timestamp:
2016-06-22T22:18:24+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13029 - Replace hookUpMapView by attachToMapView (patch by michael2402, modified) - gsoc-core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapViewState.java

    r10399 r10458  
    44import java.awt.Container;
    55import java.awt.Point;
     6import java.awt.Rectangle;
    67import java.awt.geom.AffineTransform;
    78import java.awt.geom.Point2D;
     
    135136
    136137    /**
     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    /**
    137148     * Gets the center of the view.
    138149     * @return The center position.
     
    194205    public MapViewState movedTo(MapViewPoint mapViewPoint, EastNorth newEastNorthThere) {
    195206        EastNorth delta = newEastNorthThere.subtract(mapViewPoint.getEastNorth());
    196         if (delta.distanceSq(0, 0) < .000001) {
     207        if (delta.distanceSq(0, 0) < .1e-20) {
    197208            return this;
    198209        } else {
     
    397408         * Gets a rough estimate of the bounds by assuming lat/lon are parallel to x/y.
    398409         * @return The bounds computed by converting the corners of this rectangle.
     410         * @see #getLatLonBoundsBox()
    399411         */
    400412        public Bounds getCornerBounds() {
     
    403415            return b;
    404416        }
     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        }
    405427    }
    406428
Note: See TracChangeset for help on using the changeset viewer.