dashboard: fix media visualiser spacing

Fix the spacing between the visualiser and cover
This commit is contained in:
2 * r + 2 * t 2025-05-28 11:07:29 +08:00
parent 0c7d782d17
commit e2cf98f944

View file

@ -72,11 +72,16 @@ Item {
const values = root.cava; const values = root.cava;
const len = values.length; const len = values.length;
ctx.strokeStyle = Colours.palette.m3primary;
ctx.lineWidth = 360 / len - Appearance.spacing.small / 4;
ctx.lineCap = "round";
const size = DashboardConfig.sizes.mediaVisualiserSize; const size = DashboardConfig.sizes.mediaVisualiserSize;
const cx = centerX; const cx = centerX;
const cy = centerY; const cy = centerY;
const rx = innerX; const rx = innerX + ctx.lineWidth / 2;
const ry = innerY; const ry = innerY + ctx.lineWidth / 2;
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
const v = Math.max(1, Math.min(100, values[i])); const v = Math.max(1, Math.min(100, values[i]));
@ -90,10 +95,6 @@ Item {
ctx.lineTo(cx + (rx + magnitude) * cos, cy + (ry + magnitude) * sin); ctx.lineTo(cx + (rx + magnitude) * cos, cy + (ry + magnitude) * sin);
} }
ctx.strokeStyle = Colours.palette.m3primary;
ctx.lineWidth = 360 / len - Appearance.spacing.small / 4;
ctx.lineCap = "round";
ctx.stroke(); ctx.stroke();
} }
} }