sparkline: fix missing bottom-left fill corner

This commit is contained in:
Damocles 2026-04-25 10:54:37 +02:00
parent f6c93ad9d9
commit 034f0b6d85

View file

@ -109,7 +109,6 @@ Canvas {
return bx + bw / 2;
}
function traceCurve() {
ctx.moveTo(0, yOf(d[0]));
if (n === 1) {
ctx.lineTo(width, yOf(d[0]));
} else {
@ -127,6 +126,7 @@ Canvas {
const baseY = lo < 0 ? yOf(0) : height;
ctx.beginPath();
ctx.moveTo(0, baseY);
ctx.lineTo(0, yOf(d[0]));
traceCurve();
ctx.lineTo(width, baseY);
ctx.closePath();
@ -158,6 +158,7 @@ Canvas {
// Stroke line on top
ctx.beginPath();
ctx.moveTo(0, yOf(d[0]));
traceCurve();
ctx.strokeStyle = strokeColor.toString();
ctx.lineWidth = root.lineWidth;