Ver Fonte

Fixed crash when undoing command-copying entities in screen editor

Ivan Safrin há 12 anos atrás
pai
commit
676ac68c8f

+ 2 - 0
IDE/Contents/Source/PolycodeEditor.cpp

@@ -119,6 +119,8 @@ void PolycodeEditor::handleEvent(Event *event) {
 
 void PolycodeEditor::didAction(String actionName, PolycodeEditorActionData *beforeData, PolycodeEditorActionData *afterData, bool setFileChanged) {
 
+	printf("DID ACTION:%s\n", actionName.c_str());
+
 	if(setFileChanged) {
 		setHasChanges(true);
 	}

+ 5 - 0
IDE/Contents/Source/PolycodeScreenEditor.cpp

@@ -2216,6 +2216,11 @@ void PolycodeScreenEditorMain::handleEvent(Event *event) {
 						}
 					}
 					firstMove = false;
+					beforeData = new PolycodeScreenEditorActionData();						
+					for(int i=0; i < selectedEntities.size(); i++) {
+						beforeData->entries.push_back(PolycodeScreenEditorActionDataEntry(selectedEntities[i]->position));
+					}									
+					
 				}
 				updateCursor();
 				handleMouseMove(inputEvent->mousePosition);