-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #306917: Crash on tie in score with parts #6242
Conversation
libmscore/edit.cpp
Outdated
tr = staff->score()->excerpt()->tracks().values(strack); | ||
else if ((strack & ~3) != staffIdx) // linked staff ? |
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.
I saw this test at several places but I think this is not correct to find linked staves. In PR #6049 I used another way to find linked parts and linked staves. This PR isn't merged in master so please have a look in undoAddCR
.
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.
Thanks! I am now using your code, although it should probably be refactored in order to avoid code duplication.
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.
I'm working on a kind of "API" regarding linked staves and parts so we don't have to reinvent the same square wheel again 😃
libmscore/edit.cpp
Outdated
@@ -4567,7 +4568,8 @@ void Score::undoAddElement(Element* element) | |||
|
|||
int it = 0; | |||
for (int ntrack : tr) { | |||
if ((ntrack & ~3) != staffIdx * VOICES) { | |||
// Skip this track if it is in a linked staff within the same Score, unless adding a Tie | |||
if ((ntrack & ~3) != staffIdx * VOICES && !element->isTie()) { |
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.
Same here.
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.
Actually, I think I can delete this bit altogether, now that I am using your method for constructing the list of tracks.
aa4de0b
to
d01c55d
Compare
Resolves: https://musescore.org/en/node/306917. Apply the same method from https:://github.com/musescore/pull/6049 in undoAddElement() for determining the tracks in which to place new elements.
d01c55d
to
3a8bdf1
Compare
Resolves: https://musescore.org/en/node/306917.
This now uses the same method from #6049 in undoAddElement() for determining the tracks in which to place new elements.