Fix #212 — draw back-to-back bars as written - #215
Merged
Merged
Conversation
A bar written in its own right — after a bar of its own, as in `:| ::` or `| |`, or at the head of the tune — is now drawn whole wherever it falls, as abcm2ps draws it, rather than dropped or drawn on top of the bar before it. - The sizer records whether a measure owns its opening bar (it is not the previous measure's closing bar restated) and the lead that bar needs: ~2.4 staff spaces clear of the bar it follows mid-line, and at the head of a system its leftmost ink where a `|:`'s thick line starts. - VerticalLayoutEngine draws an owned bar whole at that offset; a bar split across a system break (#197) is handled as before. - Bars VoiceAligner pads with are never owned. 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.
Fix #212
Summary
Engrave what is written: a bar written straight after another bar is a second bar, and is now drawn whole, wherever it falls, as abcm2ps 8.14 draws it.
:|ending one line,::opening the next): drawn whole (:][:) instead of only its start-repeat half. The same goes for|,||,:|,|], which were dropped before. Leftmost ink starts where a|:'s thick line does, matching abcm2ps;|:itself does not move.| |,|] [|,|| ||,:| :|,:| ::,:| |:): both bars drawn, ~2.4 staff spaces apart (measured from abcm2ps), instead of one on top of the other.::on a break is still split (A |: at the end of a line is drawn past the staff end, and again at the start of the next line #197). Variant endings render identically. BarsVoiceAlignerpads with are never treated as written.How
SizedMeasuregainsownsOpeningBar(the opening bar is not the previous measure's closing bar restated) andopeningBarLead(the room it needs ahead of its anchor). The renderer's sizing loop tracks each voice's last closing bar to decide ownership. The lead differs mid-line and at a system start, so it uses the existingsystemStartMeasuressizing.VerticalLayoutEnginedraws an owned bar at its offset.Differs from abcm2ps
abcm2ps merges
:| |:into a single::. This PR draws both bars, per the draw-what-is-written principle in the issue.Tests
RepeatAtSystemBreakTestsadds tests for line-start bars, line-end bars not restated, and mid-line pairs; they fail without the fix. Full suite passes (788 + 694 + 22) with no snapshot changes.🤖 Generated with Claude Code