Ignore:
Timestamp:
2025-11-06T16:11:22+01:00 (6 weeks ago)
Author:
GerdP
Message:

fix #21523: Setting the direction of a panned 360 photo causes a counterintuitive result

  • apply photoadjust_21523_fix_direction_360.patch by gillux: "The arrow direction does not display the exif direction angle, instead it displays exif angle + image viewer angle. So when the plugin sets the exif angle from the arrow direction, it needs to substract the image viewer angle from it."
  • remove targets from build.xml which invoke perl or overwrite the code to build javadoc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java

    r36333 r36463  
    1616import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
    1717import org.openstreetmap.josm.gui.layer.geoimage.ImageViewerDialog;
     18import org.openstreetmap.josm.gui.util.imagery.Vector3D;
     19import org.openstreetmap.josm.tools.Utils;
    1820
    1921/**
     
    240242        }
    241243        final LatLon mouseLL = MainApplication.getMap().mapView.getLatLon(evt.getX(), evt.getY());
     244        Vector3D viewerVector = ImageViewerDialog.getInstance().getRotation(photo);
     245        double viewerAngle = viewerVector != null ? Utils.toDegrees(viewerVector.getPolarAngle()) : 0d;
    242246        // The projection doesn't matter here.
    243         double direction = photoLL.bearing(mouseLL) * 360.0 / 2.0 / Math.PI;
     247        double direction = photoLL.bearing(mouseLL) * 360.0 / 2.0 / Math.PI - viewerAngle;
    244248        if (direction < 0.0) {
    245249            direction += 360.0;
Note: See TracChangeset for help on using the changeset viewer.