Fix #197 — split a repeat sign that falls on a system break - #209
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):|:,[|::::|||:(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 theResolvedLayoutagree. 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.|:and::are drawn whole as before.The three line-break tests fail without the fix.
swift testpasses (756 tests).🤖 Generated with Claude Code