From: Mathias Küsel Date: Mon, 18 Jan 2016 16:46:11 +0000 (+0100) Subject: Fixes resize() function X-Git-Tag: v2.0.0~65^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1911%2Fhead;p=thirdparty%2FChart.js.git Fixes resize() function --- diff --git a/src/core/core.controller.js b/src/core/core.controller.js index e4da7af74..654964c0b 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -90,12 +90,15 @@ var sizeChanged = this.chart.width !== newWidth || this.chart.height !== newHeight; + if (!sizeChanged) + return this; + canvas.width = this.chart.width = newWidth; canvas.height = this.chart.height = newHeight; helpers.retinaScale(this.chart); - if (!silent && sizeChanged) { + if (!silent) { this.stop(); this.update(this.options.responsiveAnimationDuration); }