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()); };