Store view transform and selectedIDs w/history, and undo/redo them

(closes #2204)
This commit is contained in:
Bryan Housel
2016-12-10 23:25:58 -05:00
parent dc5da7b480
commit 6ca4b13304
5 changed files with 66 additions and 23 deletions
+5 -2
View File
@@ -26,6 +26,9 @@ export function coreHistory(context) {
annotation = actions.pop();
}
stack[index].transform = context.projection.transform();
stack[index].selectedIDs = context.selectedIDs();
var graph = stack[index].graph;
for (var i = 0; i < actions.length; i++) {
graph = actions[i](graph);
@@ -129,7 +132,7 @@ export function coreHistory(context) {
if (stack[index].annotation) break;
}
dispatch.call('undone');
dispatch.call('undone', this, stack[index]);
return change(previous);
},
@@ -142,7 +145,7 @@ export function coreHistory(context) {
if (stack[index].annotation) break;
}
dispatch.call('redone');
dispatch.call('redone', this, stack[index]);
return change(previous);
},