From f19dc2c1b3098cea9d916bb100e00642e90c3b1e Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Tue, 23 Jun 2026 21:26:54 -0700 Subject: [PATCH] Centre pedal knob rows Short knob rows (one or two knobs) now sit centred in the enclosure instead of left-aligned, via symmetric spacers around each row. Shared PedalView, so it applies on macOS and iOS. Co-Authored-By: Claude Opus 4.8 --- Sources/LyrebirdShoeGazeUI/PedalView.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Sources/LyrebirdShoeGazeUI/PedalView.swift b/Sources/LyrebirdShoeGazeUI/PedalView.swift index ded0e55..6ebcf74 100644 --- a/Sources/LyrebirdShoeGazeUI/PedalView.swift +++ b/Sources/LyrebirdShoeGazeUI/PedalView.swift @@ -313,18 +313,17 @@ public struct PedalView: View { return VStack(spacing: PedalView.knobSpacing) { ForEach(Array(rows.enumerated()), id: \.offset) { rowPair in let row: [PedalKnob] = rowPair.element + // Centre each row: a short row (one or two knobs) sits centred in the + // enclosure rather than left-aligned. Symmetric spacers also centre a full + // three-knob row, so every row stays horizontally centred. HStack(spacing: PedalView.knobSpacing) { + Spacer(minLength: 0) ForEach(Array(row.enumerated()), id: \.offset) { knobPair in let knob: PedalKnob = knobPair.element ParameterKnob(knob.label, node: knob.node, range: knob.range) .foregroundStyle(Color.white) } - // Pad short rows so knobs stay aligned in their columns. - if row.count < PedalView.knobColumnCount { - ForEach(0 ..< (PedalView.knobColumnCount - row.count), id: \.self) { _ in - Spacer() - } - } + Spacer(minLength: 0) } } }