]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/undo/UndoAddAltitudeOffset.java
Version 14, October 2012
[GpsPrune.git] / tim / prune / undo / UndoAddAltitudeOffset.java
index 4dbdd08f3dc4b6f5c06d9e428662629b6d71e593..9a9f7a428ce95be69b66a3741efe120b2afe6c81 100644 (file)
@@ -3,6 +3,7 @@ package tim.prune.undo;
 import tim.prune.I18nManager;
 import tim.prune.UpdateMessageBroker;
 import tim.prune.data.Altitude;
+import tim.prune.data.DataPoint;
 import tim.prune.data.TrackInfo;
 
 /**
@@ -53,10 +54,14 @@ public class UndoAddAltitudeOffset implements UndoOperation
        {
                // Perform the inverse operation
                final int numPoints = _altitudes.length;
-               for (int i=0; i<numPoints; i++) {
-                       inTrackInfo.getTrack().getPoint(i+_startIndex).getAltitude().reset(_altitudes[i]);
+               for (int i=0; i<numPoints; i++)
+               {
+                       DataPoint point = inTrackInfo.getTrack().getPoint(i+_startIndex);
+                       point.getAltitude().reset(_altitudes[i]);
+                       point.setModified(true);
                }
                _altitudes = null;
+               inTrackInfo.getSelection().markInvalid();
                UpdateMessageBroker.informSubscribers();
        }
 }