]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/RemovePhotoFunction.java
Version 17, September 2014
[GpsPrune.git] / tim / prune / function / RemovePhotoFunction.java
index 8cdf7bcf3cc935bddf3c47a374b85e460db1db66..86f3ae80621281ad1ec8a1b3498b84be38875c1a 100644 (file)
@@ -48,8 +48,11 @@ public class RemovePhotoFunction extends GenericFunction
                        else
                        {
                                // point is attached, so need to confirm point deletion
+                               final int pointIndex = _app.getTrackInfo().getTrack().getPointIndex(currentPhoto.getDataPoint());
                                undoAction = new UndoDeletePhoto(currentPhoto, _app.getTrackInfo().getSelection().getCurrentPhotoIndex(),
-                                       currentPhoto.getDataPoint(), _app.getTrackInfo().getTrack().getPointIndex(currentPhoto.getDataPoint()));
+                                       currentPhoto.getDataPoint(), pointIndex);
+                               undoAction.setAtBoundaryOfSelectedRange(pointIndex == _app.getTrackInfo().getSelection().getStart() ||
+                                       pointIndex == _app.getTrackInfo().getSelection().getEnd());
                                int response = JOptionPane.showConfirmDialog(_app.getFrame(),
                                        I18nManager.getText("dialog.deletephoto.deletepoint"),
                                        I18nManager.getText("dialog.deletephoto.title"),