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 #48026: bad copy of full measure rest #1780

Merged
merged 1 commit into from
Feb 18, 2015

Conversation

MarcSabatella
Copy link
Contributor

Prior to 9a705e1, we would copy a measure rest whether it made sense or not, creating corruption. That commit fixed that, but we lost the ability to copy measure rests as measure rests. And a new corruption was introduced, if the measure rest could not be converted to a single duration rest (eg, 5/4).

Since we already have just above to split up rests that don't fit in the measure, I moved the check for duration rests to a spot earlier in the function so we could take advantage of that rest-splitting code. And I only invoke it we are pasting a measure rest to a location that is not the beginning of the measure, or if the length of the rest doesn't match the length of the measure. This allows us to still copy measure rests normally (eg, a simple range of measures). I have verified this fixes the current issue as well as the previous bug, and I also tested a variety of other cases involving 5/4, etc.

The only thing potentially off is the check to see if the rest duration matches the measure duration. Time stretch could possibly mess that up, and I don't know what the right semantics are. But I think even that calculation comes out wrong, you still get something reasonable / not corrupt.

lasconic added a commit that referenced this pull request Feb 18, 2015
@lasconic lasconic merged commit d3f8dd5 into musescore:master Feb 18, 2015
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.

2 participants