Ignore:
Timestamp:
2021-10-09T20:42:32+02:00 (3 years ago)
Author:
Don-vip
Message:

see #16472 - draw direction arrow of 360 images

File:
1 edited

Legend:

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

    r18246 r18263  
    3232import org.openstreetmap.josm.data.preferences.IntegerProperty;
    3333import org.openstreetmap.josm.gui.MainApplication;
     34import org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable;
    3435import org.openstreetmap.josm.gui.layer.geoimage.viewers.projections.IImageViewer;
    3536import org.openstreetmap.josm.gui.layer.geoimage.viewers.projections.ImageProjectionRegistry;
     
    3738import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings.FilterChangeListener;
    3839import org.openstreetmap.josm.gui.util.GuiHelper;
     40import org.openstreetmap.josm.gui.util.imagery.Vector3D;
    3941import org.openstreetmap.josm.spi.preferences.Config;
    4042import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     
    510512                    }
    511513                }
    512                 // We have to update the mousePointInImg for 360 image panning, as otherwise the panning
    513                 // never stops.
     514                // We have to update the mousePointInImg for 360 image panning, as otherwise the panning never stops.
    514515                // This does not work well with the perspective viewer at this time (2021-08-26).
    515                 if (entry != null && Projections.EQUIRECTANGULAR == entry.getProjectionType()) {
     516                boolean is360panning = entry != null && Projections.EQUIRECTANGULAR == entry.getProjectionType();
     517                if (is360panning) {
    516518                    this.mousePointInImg = p;
    517519                }
    518520                ImageDisplay.this.repaint();
     521                if (is360panning) {
     522                    // repaint direction arrow
     523                    MainApplication.getLayerManager().getLayersOfType(GeoImageLayer.class).forEach(AbstractMapViewPaintable::invalidate);
     524                }
    519525            }
    520526
     
    983989
    984990    /**
     991     * Get the rotation in the image viewer for an entry
     992     * @param entry The entry to get the rotation for. May be {@code null}.
     993     * @return the current rotation in the image viewer, or {@code null}
     994     * @since 18263
     995     */
     996    public Vector3D getRotation(IImageEntry<?> entry) {
     997        return entry != null ? getIImageViewer(entry).getRotation() : null;
     998    }
     999
     1000    /**
    9851001     * Ensure that a rectangle isn't zoomed in too much
    9861002     * @param rectangle The rectangle to get (typically the visible area)
Note: See TracChangeset for help on using the changeset viewer.