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

Fix control points on animated line w/o border #9592

Merged
merged 1 commit into from Sep 2, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions src/elements/element.line.js
Expand Up @@ -395,15 +395,13 @@ export default class LineElement extends Element {
const options = me.options || {};
const points = me.points || [];

if (!points.length || !options.borderWidth) {
return;
}
if (points.length && options.borderWidth) {
ctx.save();

ctx.save();
draw(ctx, me, start, count);

draw(ctx, me, start, count);

ctx.restore();
ctx.restore();
}

if (me.animated) {
// When line is animated, the control points and path are not cached.
Expand Down
41 changes: 41 additions & 0 deletions test/fixtures/controller.line/fill/no-border.js
@@ -0,0 +1,41 @@
module.exports = {
config: {
type: 'line',
data: {
labels: [0, 1, 2, 3, 4, 5],
datasets: [
{
data: [12, 19, 3, 5, 2, 3],
backgroundColor: '#ff0000',
borderWidth: 0,
tension: 0.4,
fill: true
},
]
},
options: {
animation: {
duration: 1
},
scales: {
x: {display: false},
y: {display: false}
},
plugins: {
legend: false,
title: false,
tooltip: false,
filler: true
}
}
},
options: {
canvas: {
height: 256,
width: 512
},
run() {
return new Promise(resolve => setTimeout(resolve, 50));
}
}
};
Binary file added test/fixtures/controller.line/fill/no-border.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.