Ignore:
Timestamp:
2013-08-28T03:03:40+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #9024 - bbox/bounds memory optimizations (modified patch by shinigami) + javadoc

Location:
trunk/src/org/openstreetmap/josm/data/coor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java

    r6169 r6203  
    33
    44import java.io.Serializable;
     5
     6import org.openstreetmap.josm.data.osm.BBox;
    57
    68/**
     
    8991    }
    9092
     93    /**
     94     * Converts to single point BBox.
     95     *
     96     * @return single point BBox defined by this coordinate.
     97     * @since 6203
     98     */
     99    public BBox toBBox() {
     100        return new BBox(x, y);
     101    }
     102   
     103    /**
     104     * Creates bbox around this coordinate. Coordinate defines
     105     * center of bbox, its edge will be 2*r.
     106     *
     107     * @param r size
     108     * @return BBox around this coordinate
     109     * @since 6203
     110     */
     111    public BBox toBBox(final double r) {
     112        return new BBox(x - r, y - r, x + r, y + r);
     113    }
     114
    91115    @Override
    92116    public int hashCode() {
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r6178 r6203  
    216216    public boolean isOutSideWorld() {
    217217        Bounds b = Main.getProjection().getWorldBoundsLatLon();
    218         return lat() < b.getMin().lat() || lat() > b.getMax().lat() ||
    219                 lon() < b.getMin().lon() || lon() > b.getMax().lon();
     218        return lat() < b.getMinLat() || lat() > b.getMaxLat() ||
     219                lon() < b.getMinLon() || lon() > b.getMaxLon();
    220220    }
    221221
Note: See TracChangeset for help on using the changeset viewer.