diff --git a/shell/applets/SparklineCanvas.qml b/shell/applets/SparklineCanvas.qml index cffabb1..4322656 100644 --- a/shell/applets/SparklineCanvas.qml +++ b/shell/applets/SparklineCanvas.qml @@ -142,10 +142,12 @@ Canvas { if (hasCF) ctx.fillStyle = colorFunction(d[i]).toString(); const [bx, bw] = xOf(i); + const x0 = Math.floor(bx); + const x1 = Math.floor(bx + bw); const dy = yOf(d[i]); const barTop = Math.min(dy, zy); const barH = Math.max(1, Math.abs(dy - zy)); - ctx.fillRect(bx, barTop, Math.ceil(bw), barH); + ctx.fillRect(x0, barTop, Math.max(1, x1 - x0), barH); } } }