-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #302316, fix #297501 - slurs and fingering #5812
Conversation
Wow, really great detective work! Your analysis makes perfect sense to me. Only question in my mind then is whether we can save a little time by only doing the createShapes() call if there are in fact chord-based fingerings that needed layout. So, move it one line up, preceded by "if (!fingerings.empty())" or whatever. I don't think adding the beams to the skyline will affect segments shapes, although if it does, you probably just fixed another bug by doing it unconditionally :-) |
d938fcc
to
11db1a6
Compare
I was quite a search indeed :-). And when I than finally found the solution I must admit I forgot the potential performance issue. Thanks for the remark. |
This PR is related to #5822 but has a different root cause and is therefor independent. |
After looking into more, similar issues, e.g. #292614 and #297482, I start wandering whether an extra layout during read-in is a better solution instead of trying to solve this issues in the auto-layout. I see 4 solutions for this:
For me options 3 and 4 are not the way to go, it is a major rework which might touch more fundamentals of MuseScore. Any comments on this? |
I would admit that layout algorithm should be designed in a way in which applying this algorithm once makes the entire score (or its relevant part in case of partial layout) be fully correctly laid out. Therefore making layout algorithm rely on things which were set up by previous layouts is, in my opinion, an incorrect way to go. So I would say that we should indeed solve the issues within layout algorithm, be it by fixing them within the existing algorithm structure (which is indeed likely to complicate if further) or by doing some larger redesign of the algorithm or its parts (which requires more work, larger test scores base and might indeed be not something that would be done right now). Adding extra layout on loading a score actually hides the real issue, and while the real issue is present it is likely that there is a way to break this algorithm during an interactive usage of the editor as well. |
11db1a6
to
486d4a5
Compare
486d4a5
to
fef8d45
Compare
fef8d45
to
c71c4ea
Compare
To me this is ready to be merged. |
@anatoly-os, go? :-) |
When a score, containing a fingering under a slur is loaded, the slur crosses the fingering. Only after a relayout the slur is drawn higher so it won't intersect the fingering (issue The root cause of this issue is the shapes of the fingering elements where not available when the bezier of the slur is calculated. The fingering shapes are calculated after the slur bezier is calculated. This explains why a relayout will solve the issue, then the fingering shapes are available. The shapes are calculated during the calculation of the note shapes but there was no call the fingering layout() method, making the bbox of the fingering shape invalid and therefor it is not added. This issue is solved by, in Score::layoutSystemElements(), calling the Segment::createShapes() when layouting the fingering elements. This solution also solves #302316 which also requires a relayout after a String Fingering is added to note under a slur.
c71c4ea
to
8f1d51a
Compare
Resolves: #302316 - String number under slur interferes with slur.
Resolves: #297501 - Layout shift of slur after reload
When a score, containing a fingering under a slur is loaded, the slur crosses the fingering. Only after a re-layout the slur is drawn higher so it won't intersect the fingering (issue
The root cause of this issue is the shapes of the fingering elements where not available when the bezier of the slur is calculated. The fingering shapes are calculated after the slur bezier is calculated. This explains why a re-layout will solve the issue, then the fingering shapes are available. The shapes are calculated during the calculation of the note shapes but there was no call the fingering
layout()
method, making thebbox
of the fingering shape invalid and therefor it is not added.This issue is solved by, in
Score::layoutSystemElements()
, calling theSegment::createShapes()
when lay-outing the fingering elements.This solution also solves #302316 which also requires a re-layout after a String Fingering is added to note under a slur.
This PR replaces PR5797 which was just a quick solution.