From 06b22245b14d6d61fcad4235120ccd77f51117f0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 12 Dec 2016 16:00:38 +0100 Subject: [PATCH] canvas widget base: clean --- src/browser/js/app/widgets/common/_canvas_base.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/browser/js/app/widgets/common/_canvas_base.js b/src/browser/js/app/widgets/common/_canvas_base.js index 019a001a..6f261a15 100644 --- a/src/browser/js/app/widgets/common/_canvas_base.js +++ b/src/browser/js/app/widgets/common/_canvas_base.js @@ -37,17 +37,18 @@ _canvas_base.prototype.resizeHandleProxy = function() { _canvas_base.prototype.resizeHandle = function(e, width, height, checkColors){ - var width = width || this.canvas.width(), - height = height || this.canvas.height() + var width = width, + height = height - if (height==100 && width==100) return + if (width && height) { + this.height=height + this.width=width - this.height=height - this.width=width + this.canvas[0].setAttribute('width',width) + this.canvas[0].setAttribute('height',height) - this.canvas[0].setAttribute('width',width) - this.canvas[0].setAttribute('height',height) + } if (!this.visible || checkColors) { this.visible = true