From 310eada01aaa666f17b58fdad1eba6da38806063 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Tue, 5 Jan 2016 20:16:18 -0500 Subject: [PATCH] Do not force resize if the size has not changed --- src/core/core.controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 17b875c5e..ea58c3ef7 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -63,6 +63,7 @@ this.updateLayout(); this.resetElements(); this.initToolTip(); + this.draw(); this.update(); // TODO @@ -83,17 +84,19 @@ }, resize: function resize(silent) { - this.stop(); var canvas = this.chart.canvas; var newWidth = helpers.getMaximumWidth(this.chart.canvas); var newHeight = (this.options.maintainAspectRatio && isNaN(this.chart.aspectRatio) === false && isFinite(this.chart.aspectRatio) && this.chart.aspectRatio !== 0) ? newWidth / this.chart.aspectRatio : helpers.getMaximumHeight(this.chart.canvas); + var sizeChanged = this.chart.width !== newWidth || this.chart.height !== newHeight; + canvas.width = this.chart.width = newWidth; canvas.height = this.chart.height = newHeight; helpers.retinaScale(this.chart); - if (!silent) { + if (!silent && sizeChanged) { + this.stop(); this.update(this.options.responsiveAnimationDuration); } -- 2.47.2