Changeset 18503 in josm for trunk/src/org


Ignore:
Timestamp:
2022-06-28T23:19:33+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #22170: AIOOBE in org.openstreetmap.josm.gui.util.imagery.CameraPlane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r18263 r18503  
    698698        IImageViewer currentImageViewer;
    699699        BufferedImage currentImage;
    700         VisRect currentVisibleRect;
    701700        boolean currentErrorLoading;
    702701
     
    705704            currentEntry = this.entry;
    706705            currentOldEntry = this.oldEntry;
    707             currentVisibleRect = this.visibleRect;
    708706            currentErrorLoading = this.errorLoading;
    709707        }
     
    717715        if (currentImage != null && (currentEntry != null || currentOldEntry != null)) {
    718716            currentImageViewer = this.getIImageViewer(currentEntry);
     717            // This must be after the getIImageViewer call, since we may be switching image viewers. This is important,
     718            // since an image viewer on switch may change the visible rectangle.
     719            VisRect currentVisibleRect;
     720            synchronized (this) {
     721                currentVisibleRect = this.visibleRect;
     722            }
    719723            Rectangle r = new Rectangle(currentVisibleRect);
    720724            Rectangle target = calculateDrawImageRectangle(currentVisibleRect, size);
Note: See TracChangeset for help on using the changeset viewer.