fix #181656: layout glitch after hbox on undo #3110
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.
My previous fix in #3052 had an unfortunate side effect: now that we pay attention to break hints on hboxes, we start to see that they are actually set inappropriately on "internal" hboxes. That is, hboxes within a system row. That's because they are seen as ending a system, and the code that sets the break hints does so system by system. So now we are actually always breaking after hboxes while in undo state - the first layout after an undo.
This current PR moves the setting of break hints from Score::layoutSystem() to Score::layoutSystemRow(), and checks to only set the hint to true on the last measurebase of the row, not on the last measure of each system.
This fixes the current problem without compromising the fix to the previous problem. I can't swear it doesn't have some other unforeseen side effect. But all this break hint stuff only affects layout in undo state, so worst case is there is some other temporary glitch on undo.
It wouldn't break my heart to simply revert the fix in #3052 (thus leaving the previous bug unfixed for 2.1). This all becomes moot for 3.0 it seems anyhow. But I do think this current PR is the "right" solution, at least to the extent I understand how these break hints are designed to work.