Josh Engebretson 10 years ago
parent
commit
98e74fbb85
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Source/AtomicEditor/Editors/SceneEditor3D/SceneEditHistory.cpp

+ 6 - 2
Source/AtomicEditor/Editors/SceneEditor3D/SceneEditHistory.cpp

@@ -43,6 +43,8 @@ void SceneEditHistory::AddUndoOp(SceneHistoryOp* op)
         delete redoHistory_[i];
         delete redoHistory_[i];
     }
     }
 
 
+    redoHistory_.Clear();
+
     if (activeNode_.NotNull())
     if (activeNode_.NotNull())
     {
     {
         if (op->type_ == SCENEHISTORYOP_NODECHANGED)
         if (op->type_ == SCENEHISTORYOP_NODECHANGED)
@@ -61,7 +63,6 @@ void SceneEditHistory::AddUndoOp(SceneHistoryOp* op)
         }
         }
     }
     }
 
 
-    redoHistory_.Clear();
 }
 }
 
 
 void SceneEditHistory::HandleHistoryNodeAdded(StringHash eventType, VariantMap& eventData)
 void SceneEditHistory::HandleHistoryNodeAdded(StringHash eventType, VariantMap& eventData)
@@ -85,6 +86,7 @@ void SceneEditHistory::HandleHistoryNodeChanged(StringHash eventType, VariantMap
         return;
         return;
 
 
     Scene* scene = static_cast<Scene*>(eventData[HistoryNodeChanged::P_SCENE].GetPtr());
     Scene* scene = static_cast<Scene*>(eventData[HistoryNodeChanged::P_SCENE].GetPtr());
+
     if (scene != scene_)
     if (scene != scene_)
         return;
         return;
 
 
@@ -215,6 +217,8 @@ void SceneEditHistory::Redo()
 
 
     op->Redo();
     op->Redo();
 
 
+    undoHistory_.Push(op);
+
     VariantMap eventData;
     VariantMap eventData;
     if (op->type_ == SCENEHISTORYOP_NODECHANGED)
     if (op->type_ == SCENEHISTORYOP_NODECHANGED)
     {
     {
@@ -229,7 +233,7 @@ void SceneEditHistory::Redo()
         ccop->component_->SendEvent(E_HISTORYCOMPONENTCHANGEDUNDOREDO, eventData);
         ccop->component_->SendEvent(E_HISTORYCOMPONENTCHANGEDUNDOREDO, eventData);
     }
     }
 
 
-    undoHistory_.Push(op);
+
 
 
 }
 }