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 #306917: Crash on tie in score with parts #6242

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

mattmcclinch
Copy link
Contributor

@mattmcclinch mattmcclinch commented Jun 21, 2020

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.

tr = staff->score()->excerpt()->tracks().values(strack);
else if ((strack & ~3) != staffIdx) // linked staff ?
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 😃

@@ -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()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

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.

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.
@anatoly-os anatoly-os merged commit 1168e0f into musescore:3.x Jun 24, 2020
anatoly-os added a commit that referenced this pull request Aug 11, 2020
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.

3 participants