mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Fix control points on animated line w/o border (#9592)
Co-authored-by: Jukka Kurkela <jukka.kurkela@scmbest.fi>
This commit is contained in:
parent
3ed94559dd
commit
8d68b119bc
@ -395,16 +395,14 @@ 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();
|
||||
|
||||
draw(ctx, me, start, count);
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
ctx.save();
|
||||
|
||||
draw(ctx, me, start, count);
|
||||
|
||||
ctx.restore();
|
||||
|
||||
if (me.animated) {
|
||||
// When line is animated, the control points and path are not cached.
|
||||
me._pointsUpdated = false;
|
||||
|
41
test/fixtures/controller.line/fill/no-border.js
vendored
Normal file
41
test/fixtures/controller.line/fill/no-border.js
vendored
Normal file
@ -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));
|
||||
}
|
||||
}
|
||||
};
|
BIN
test/fixtures/controller.line/fill/no-border.png
vendored
Normal file
BIN
test/fixtures/controller.line/fill/no-border.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
Loading…
Reference in New Issue
Block a user