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) } } }