Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Avoid updating Chart when responsive: true and Chart is hidden. #5172

Merged
merged 2 commits into from May 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/core/core.controller.js
Expand Up @@ -177,7 +177,7 @@ module.exports = function(Chart) {
// the canvas render width and height will be casted to integers so make sure that
// the canvas display style uses the same integer values to avoid blurring effect.

// Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collased
// Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collapsed
var newWidth = Math.max(0, Math.floor(helpers.getMaximumWidth(canvas)));
var newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers.getMaximumHeight(canvas)));

Expand Down Expand Up @@ -557,6 +557,10 @@ module.exports = function(Chart) {

me.transition(easingValue);

if (me.width <= 0 || me.height <= 0) {
return;
}

if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {
return;
}
Expand Down