fix #51271: remaining issues with initial barline #1937
Merged
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.
The initial barline code had mostly been working fine, but was broken with the change to support the new hideSystemBarLine flag. My fix here preserves the behavior of this flag but fixes the cases of 1-line staves and cases where the top visible staff has a spacer up to an invisible staff above. So this also fixes https://musescore.org/en/node/53856.
@wschweer , @lasconic : I do believe my fix works, and I tested all sorts of combinations of 1-line staves, hidden staves, staves with hideSystemBarLine set, etc. But you might want to look and sure I didn't miss something.
I also included a fix for one other glitch with initial barlines : on system layout, if the top staff is 1-line, we explicit set the span from to the right value, but if you later change the number of lines or add a staff above this one, we didn't ever reset it to the default value, so you end up with system barlines extended 2sp above the system (fixed on reload). I just added code to the system layout to explicitly set the spanFrom to 0 if the top visible staff is not a 1-line staff.