Skip to content

Commit

Permalink
Clip chart area before filling
Browse files Browse the repository at this point in the history
- Add clip and unclip around doFill() call
- This fixes #4450
  • Loading branch information
nagix authored and etimberg committed Jul 4, 2017
1 parent 9ec78ce commit 6e54bc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/plugin.filler.js
Expand Up @@ -296,14 +296,17 @@ module.exports = function(Chart) {
return;
}

var ctx = chart.ctx;
var el = meta.el;
var view = el._view;
var points = el._children || [];
var mapper = meta.mapper;
var color = view.backgroundColor || defaults.global.defaultColor;

if (mapper && color && points.length) {
doFill(chart.ctx, points, mapper, view, color, el._loop);
helpers.canvas.clipArea(ctx, chart.chartArea);
doFill(ctx, points, mapper, view, color, el._loop);
helpers.canvas.unclipArea(ctx);
}
}
};
Expand Down

0 comments on commit 6e54bc5

Please sign in to comment.