Skip to content

Fix #197 — split a repeat sign that falls on a system break - #209

Merged
sbeitzel merged 1 commit into
developfrom
feature/fix_197
Oct 3, 2026
Merged

sbeitzel merged 1 commit into
developfrom
feature/fix_197

Conversation

@sbeitzel

@sbeitzel sbeitzel commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

A repeat sign at a line break is now split across it, matching abcm2ps (checked by rendering the same sources with abcm2ps -g, abcm2ps 8.14.0):

Source at line end End of this system Start of next system
|:, [|: plain single bar start-repeat (unchanged)
:: :|| |: (was a full ::, end dots included)

Before, the closing |: was left-anchored at the staff end, so its thick line and dots were drawn in the right margin. :: had the same problem with its start-repeat dots, and was restated whole at the start of the next line.

The bar kinds are rewritten in VerticalLayoutEngine.resolveMeasures, so the SVG and the ResolvedLayout agree. Mid-line repeats are unchanged. Widths are unchanged too: :: and :|| already reserve the same right padding, and |: and :: the same left margin.

The |: drawing style (abcm2ps draws thick–thin–dots) is split out as #208.

Tests

RepeatAtSystemBreakTests, end to end from ABC source to SVG:

  • |: and [|: at a line end: no stroke or dot past the staff end, one thin closing stroke, and the start-repeat dots on the next line.
  • :: at a line end: :|| closes the line, and the next line opens with start-repeat dots only.
  • Mid-line |: and :: are drawn whole as before.

The three line-break tests fail without the fix. swift test passes (756 tests).

🤖 Generated with Claude Code

A |: or [|: that closes a system now draws as a plain bar line ending at
the staff end, and a :: as its end-repeat half; the next system opens with
the start-repeat (a restated :: keeps only its start-repeat half). Drawn
whole, the sign's thick line and dots landed past the end of the staff, and
a restated :: drew end-repeat dots before the first note. This matches
abcm2ps and engraving convention.

The kinds are rewritten where measures are resolved, so the emitted SVG and
the resolved layout agree. Mid-line repeats are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sbeitzel
sbeitzel merged commit ec580ae into develop Oct 3, 2026
2 checks passed
@sbeitzel
sbeitzel deleted the feature/fix_197 branch October 4, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant