-
Notifications
You must be signed in to change notification settings - Fork 2.9k
A complete overhaul of rest positioning logic #16719
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
A complete overhaul of rest positioning logic #16719
Conversation
d1befce
to
ee33a8c
Compare
aef89ab
to
127996b
Compare
@mike-spa Seems like performance is affected. |
a188a21
to
716ea0a
Compare
I think I've understood what was happening with the relayout recalculation time.
I've added a commit which fixes this (for @RomanPudashkin to check). |
Improved collision management between beam, beamlets and rests Fix beam VS horizontal spacing glitches Correct MMRest vertical placement The Rest::getSymbol method should just compute the symbol. The function should do only one thing, i.e. return the symbol. It shouldn't do vertical position calculations. Introducing Rest::computeNaturalLine This deals exclusively with the "natural" position (i.e. when the measure features only a single voice) Rest::computeLineOffset refactored to Rest::computeVoiceOffset This function was completely incoherent: it was computing voice offsets, but also vertical collision avoidance, and was also interfering with the natural rest position. Now the function does only one thing, i.e. compute the correct voice offset. Move whole rest offset logic to dedicated Rest::computeWholeRestOffset Create style setting for multi-voice rest offset Resolve rest-to-note vertical conflicts Resolve rest-to-rest vertical conflicts Resolve rest-to-beam conflicts in multi-voice situations If rests can't be moved, move beams away Resolve rest-to-rest under double beams conflicts Don't compute collisions if invisible or autoplace disabled Improved interaction with user offsets Implemented dedicated logic for multi-voice merged rests Ignore rest offsets from old versions
716ea0a
to
893ebbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance feels good now. Difference between master and the PR is no more than +-1 sec (when talking about a processes which take ~50sec)
Update: I've added a tiny (2 LOC) commit at the end cause I realized it was an obvious fix for #14650 |
and rebase shenanigans for PR musescore#16719
and rebase shenanigans for PR musescore#16719
and rebase shenanigans for PR musescore#16719
Resolves: #15301
Resolves: #14650
This PR contains a complete overhaul of the rest positioning logic, so it probably doesn't make much sense to explain in detail everething that's being done. But just as an overview:
A whole bunch of test failures is expected. I'm also going to add some more visual tests to cover all the new things I've done.
This PR includes all the work done in #16410 so I'm going to close that one.
(Still to come: logic for alignment of adjacent rests)
UPDATE: the last commit features an additional setting exposed in the Style -> Rest menu (as by @bkunda 's spec), made from a combination of QML and Widgets. It is literally copy-pasted from the implementation of the straight VS traditional flags in Style -> Note.
20230316_152301.mp4