Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #109021: wandering lines due to bad barline widths on load #3055

Merged
merged 1 commit into from
Mar 12, 2017

Conversation

MarcSabatella
Copy link
Contributor

This might not fix all the cases of so-called "wandering hairpins" that people have encountered, but it fixes the couple I have been able to reproduce. Namely, the one in https://musescore.org/en/node/109021 and the one in https://musescore.org/en/node/180601#comment-672671. Both were due to a discrepancy in the widths of a few measures resulting from a miscalculation of the widths of repeat barlines. I tracked it down to a simple root cause: a "double" scaling down the barline width in cases where the score spatium is less than the nominal 1.764mm. The same miscalculation happened with system barlines, so I applied the same simple fix there.

As I sad, I do not claim this will fix all cases of wandering hairpins et al. So I left in place a couple of commented-out qDebug statements that were key in helping me track down this particular problem. They just print the minimum widths of each measure as calculated during system layout, so we can compare the result on initial load versus after first relayout. Any discrepancy that leads to a measure jumping from one page to another will also result in wandering hairpins, so it just becomes a matter of figuring out where the discrepancy comes from. Chances are problems may still lurk in the the handling of other generated elements (headers, courtesy elements, etc). But again, the cases I can reproduce actually work out perfectly for all measures (width on load same as after first relayout) except those with repeat barlines, and this PR fixes that so these also work out perfectly.

@lasconic
Copy link
Contributor

Good stuff! Thank you for investigation!

@lasconic lasconic merged commit 932675a into musescore:2.1 Mar 12, 2017
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.

None yet

2 participants