summaryrefslogtreecommitdiff
path: root/js/undo.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/undo.js')
-rw-r--r--js/undo.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/js/undo.js b/js/undo.js
index 436422f..44b137a 100644
--- a/js/undo.js
+++ b/js/undo.js
@@ -33,6 +33,12 @@ var update_dom = function(){
update_dom_visibility('redo')
}
+// state is an undo or redo state that might contain these props
+// {lexs: {'0,0': LexState, ...},
+// focus: {x:, y: },
+// size: {w:, h: },
+// rects: [{x:, y:, w:, h:, lexs: [LexState, ...]}, ...]
+// }
var new_state = function(){
var state = {lexs:{}};
save_focus(canvas.focus_x, canvas.focus_y, state)
@@ -98,20 +104,20 @@ var save_resize = function(w, h, old_w, old_h, state){
state = state || current_undo
save_size(old_w, old_h, state)
if (old_w > w){
- // .----.
+ // .---XX
// | XX
// |___XX
save_rect(w, 0, old_w - w, old_h, state)
if (old_h > h){
// .----.
// | |
- // |XXX_|
+ // XXXX_|
save_rect(0, h, w, old_h - h, state)
}
} else if (old_h > h){
// .----.
// | |
- // |XXXX|
+ // XXXXXX
save_rect(0, h, old_w, old_h - h, state)
}
}