Changeset 13140 in josm for trunk


Ignore:
Timestamp:
2017-11-21T00:57:05+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15229 - provide a replacement API to deprecated Coordinate.toBBox() (used by plugins)

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

Legend:

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

    r13107 r13140  
    9999     * @return BBox around this coordinate
    100100     * @since 6203
    101      * @deprecated no longer supported
     101     * @deprecated use {@link BBox#BBox(double, double, double)} instead
    102102     */
    103103    @Deprecated
    104104    public BBox toBBox(final double r) {
    105         return new BBox(x - r, y - r, x + r, y + r);
     105        return new BBox(x, y, r);
    106106    }
    107107
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r12190 r13140  
    6666
    6767    /**
    68      * Create minimal  BBox so that {@code this.bounds(ax,ay)} and {@code this.bounds(bx,by)} will both return true
     68     * Creates bbox around the coordinate (x, y).
     69     * Coordinate defines center of bbox, its edge will be 2*r.
     70     *
     71     * @param x X coordinate
     72     * @param y Y coordinate
     73     * @param r size
     74     * @since 13140
     75     */
     76    public BBox(double x, double y, double r) {
     77        this(x - r, y - r, x + r, y + r);
     78    }
     79
     80    /**
     81     * Create minimal BBox so that {@code this.bounds(ax,ay)} and {@code this.bounds(bx,by)} will both return true
    6982     * @param ax left or right X value (-180 .. 180)
    7083     * @param ay top or bottom Y value (-90 .. 90)
Note: See TracChangeset for help on using the changeset viewer.