From c3855c155abc96cad6945693e2fcf6b40aa24431 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Fri, 21 Aug 2015 19:49:54 -0700 Subject: [PATCH] Fix undo/redo null input --- web/app/sketcher/canvas.js | 2 +- web/app/sketcher/history.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/app/sketcher/canvas.js b/web/app/sketcher/canvas.js index 0f51c74c..a35774d1 100644 --- a/web/app/sketcher/canvas.js +++ b/web/app/sketcher/canvas.js @@ -68,7 +68,6 @@ TCAD.TWO.Viewer = function(canvas) { this.canvas = canvas; this.io = new TCAD.IO(this); - this.historyManager = new TCAD.HistoryManager(this); var viewer = this; this.retinaPxielRatio = window.devicePixelRatio > 1 ? window.devicePixelRatio : 1; function updateCanvasSize() { @@ -107,6 +106,7 @@ TCAD.TWO.Viewer = function(canvas) { this._setupServiceLayer(); + this.historyManager = new TCAD.HistoryManager(this); this.refresh(); }; diff --git a/web/app/sketcher/history.js b/web/app/sketcher/history.js index d4bd1c0b..89dc368b 100644 --- a/web/app/sketcher/history.js +++ b/web/app/sketcher/history.js @@ -2,9 +2,7 @@ TCAD.HistoryManager = function(viewer) { this.viewer = viewer; this.dmp = new diff_match_patch(); - this.historyPointer = -1; - this.diffs = []; - this._counter = 0; + this.init(this.viewer.io.serializeSketch()); };