Skip to content

Commit

Permalink
Fixed 'undo' glitches with complex mission items.
Browse files Browse the repository at this point in the history
  • Loading branch information
m4gr3d committed Feb 7, 2015
1 parent 6911934 commit 9e56261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void onReceive(Context context, Intent intent) {
private final Drone.OnMissionItemsBuiltCallback missionItemsBuiltListener = new Drone.OnMissionItemsBuiltCallback() {
@Override
public void onMissionItemsBuilt(MissionItem.ComplexItem[] complexItems) {
notifyMissionUpdate();
notifyMissionUpdate(false);
}
};

Expand Down Expand Up @@ -121,7 +121,7 @@ public void undoMission() {
load(previousMission, false);
}

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

public static List<LatLong> getVisibleCoords(List<MissionItemProxy> mipList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MissionItemProxy {
private final Drone.OnMissionItemsBuiltCallback missionItemBuiltListener = new Drone.OnMissionItemsBuiltCallback() {
@Override
public void onMissionItemsBuilt(MissionItem.ComplexItem[] complexItems) {
mMission.notifyMissionUpdate();
mMission.notifyMissionUpdate(false);
}
};

Expand Down

0 comments on commit 9e56261

Please sign in to comment.