Changeset 17574 in josm


Ignore:
Timestamp:
2021-03-16T23:57:41+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #20598 - Update the bucket with the new bbox (patch by taylor.smock)

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r17460 r17574  
    6464        }
    6565        this.geoImages.addAll(this.data);
     66        data.forEach(image -> image.setDataSet(this));
    6667        selectedImagesIndex.add(-1);
    6768    }
     
    218219
    219220    /**
     221     * Indicate that a entry has changed
     222     * @param gpxImageEntry The entry to update
     223     * @since xxx
     224     */
     225    public void fireNodeMoved(ImageEntry gpxImageEntry) {
     226        this.geoImages.remove(gpxImageEntry);
     227        this.geoImages.add(gpxImageEntry);
     228    }
     229
     230    /**
    220231     * Remove the image from the list of selected images
    221232     * @param image {@link ImageEntry} the image to remove
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java

    r17565 r17574  
    552552    public BBox getBBox() {
    553553        // new BBox(LatLon) is null safe.
    554         // Use `getPos` instead of `getExifCoor` since the image may be coorelated against a GPX track
     554        // Use `getPos` instead of `getExifCoor` since the image may be correlated against a GPX track
    555555        return new BBox(this.getPos());
    556556    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java

    r16488 r17574  
    77import java.util.Objects;
    88
     9import org.openstreetmap.josm.data.ImageData;
    910import org.openstreetmap.josm.data.gpx.GpxImageEntry;
    1011
     
    1617
    1718    private Image thumbnail;
     19    private ImageData dataSet;
    1820
    1921    /**
     
    7678
    7779    @Override
     80    public void applyTmp() {
     81        super.applyTmp();
     82        if (this.dataSet != null) {
     83            this.dataSet.fireNodeMoved(this);
     84        }
     85    }
     86
     87    @Override
     88    public void discardTmp() {
     89        super.discardTmp();
     90        if (this.dataSet != null) {
     91            this.dataSet.fireNodeMoved(this);
     92        }
     93    }
     94
     95    /**
     96     * Set the dataset for this image
     97     * @param imageData The dataset
     98     * @since xxx
     99     */
     100    public void setDataSet(ImageData imageData) {
     101        this.dataSet = imageData;
     102    }
     103
     104    /**
     105     * Get the dataset for this image
     106     * @return The dataset
     107     * @since xxx
     108     */
     109    public ImageData getDataSet() {
     110        return this.dataSet;
     111    }
     112
     113
     114    @Override
    78115    public int hashCode() {
    79116        return Objects.hash(super.hashCode(), thumbnail);
Note: See TracChangeset for help on using the changeset viewer.