From 879fd61e4f12c857827c926f5eb917c0504238ea Mon Sep 17 00:00:00 2001 From: Catouse Date: Thu, 3 Jul 2014 09:07:00 +0800 Subject: [PATCH] * fixed clearCanvasArea. --- dist/js/zui.min.js | 5 ++--- src/js/mindmap.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dist/js/zui.min.js b/dist/js/zui.min.js index b5d7aec52..ebcf9dc86 100644 --- a/dist/js/zui.min.js +++ b/dist/js/zui.min.js @@ -5410,7 +5410,6 @@ Date.prototype.format = function(format) if(nodeData.type === 'root') { - this.clearCanvasArea(); ui.left = 0 - Math.floor(ui.width / 2); ui.top = 0 - Math.floor(ui.height / 2); @@ -5561,8 +5560,7 @@ Date.prototype.format = function(format) Mindmap.prototype.clearCanvasArea = function(nodeData, parent) { - var size = this.options.canvasSize; - this.$canvas[0].getContext("2d").clearRect(0, 0, size.width, size.height) + this.$canvas[0].getContext("2d").clearRect(0, 0, this.width, this.height) }; Mindmap.prototype.draw = function(nodeData, parent) @@ -5575,6 +5573,7 @@ Date.prototype.format = function(format) if(nodeData.type === 'root') { this.$canvas.attr({width: this.width, height: this.height}); + this.clearCanvasArea(); } if(parent) diff --git a/src/js/mindmap.js b/src/js/mindmap.js index 11c03b7f6..e5cdbdeb8 100644 --- a/src/js/mindmap.js +++ b/src/js/mindmap.js @@ -622,7 +622,6 @@ if(nodeData.type === 'root') { - this.clearCanvasArea(); ui.left = 0 - Math.floor(ui.width / 2); ui.top = 0 - Math.floor(ui.height / 2); @@ -773,8 +772,7 @@ Mindmap.prototype.clearCanvasArea = function(nodeData, parent) { - var size = this.options.canvasSize; - this.$canvas[0].getContext("2d").clearRect(0, 0, size.width, size.height) + this.$canvas[0].getContext("2d").clearRect(0, 0, this.width, this.height) }; Mindmap.prototype.draw = function(nodeData, parent) @@ -787,6 +785,7 @@ if(nodeData.type === 'root') { this.$canvas.attr({width: this.width, height: this.height}); + this.clearCanvasArea(); } if(parent) -- GitLab