Skip to content

Commit 9e56261

Browse files
committed
Fixed 'undo' glitches with complex mission items.
1 parent 6911934 commit 9e56261

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Android/src/org/droidplanner/android/proxy/mission/MissionProxy.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void onReceive(Context context, Intent intent) {
7777
private final Drone.OnMissionItemsBuiltCallback missionItemsBuiltListener = new Drone.OnMissionItemsBuiltCallback() {
7878
@Override
7979
public void onMissionItemsBuilt(MissionItem.ComplexItem[] complexItems) {
80-
notifyMissionUpdate();
80+
notifyMissionUpdate(false);
8181
}
8282
};
8383

@@ -121,7 +121,7 @@ public void undoMission() {
121121
load(previousMission, false);
122122
}
123123

124-
private void notifyMissionUpdate(boolean saveMission) {
124+
public void notifyMissionUpdate(boolean saveMission) {
125125
if (saveMission && currentMission != null) {
126126
//Store the current state of the mission.
127127
undoBuffer.add(currentMission);
@@ -633,6 +633,7 @@ public List<LatLong> getVisibleCoords() {
633633
public void movePolygonPoint(Survey survey, int index, LatLong position) {
634634
survey.getPolygonPoints().get(index).set(position);
635635
this.drone.buildMissionItemsAsync(missionItemsBuiltListener, survey);
636+
notifyMissionUpdate();
636637
}
637638

638639
public static List<LatLong> getVisibleCoords(List<MissionItemProxy> mipList) {

Android/src/org/droidplanner/android/proxy/mission/item/MissionItemProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class MissionItemProxy {
2626
private final Drone.OnMissionItemsBuiltCallback missionItemBuiltListener = new Drone.OnMissionItemsBuiltCallback() {
2727
@Override
2828
public void onMissionItemsBuilt(MissionItem.ComplexItem[] complexItems) {
29-
mMission.notifyMissionUpdate();
29+
mMission.notifyMissionUpdate(false);
3030
}
3131
};
3232

0 commit comments

Comments
 (0)