Corruption pasting tuplet if another staff/voice intersects it
Ubuntu 14.04, GIT commit: 7240a19
Two parts to this, hopefully fixable together
Part A:
1) open attached score
2) select last note of top staff of first measure
3) shift+click first note
4) copy
5) click next measure
6) paste
Result: corruption - an extra rest
Cause seems to be that while we tried to select the full tuplet, we are actually 1/8 short because of the notes in bottom staff, which aren't even involved except that I guess the selection only extends to the segment after the start of the last note of the selection. Which is to say, the selection does not contain the full length of the notes selected. Our check for incomplete tuplet selection does not catch this. Note it works fine to select the whole measure, at least with my previous fix for copying septuplets. You have to select the way I described to see the probem.
Part B
1) click fourth note in voice 1 of top staff in measure 3
2) shift+click last note
3) copy
4) click last measure
5) paste
Result: corruption
Here, we are again failing to detect the incomplete tuplet in voice 2, because we are checking only the start and end segments, and there are no problems there. The problem is the notes *within* the selection in voice 2 - specifically, the D.
In both cases, the solution is better detection of problems and disallowing the copy - I am not proposiung we actually make these operations work. I am pretty sure this is doable within the content of Selection::canCopy().
Here's a picture showing both of the resulting corruptions:
Attachment | Size |
---|---|
intersecting-tuplets.mscz | 6.16 KB |
Comments
BTW, in part B, it wasn't really necessary for the top voice to contain a tuplet at all. Same corruption exists if you have four quarter notes and try copying the third and fourth. The incomplete-tuplet-detection code won't notice the incomplete selection in voice 2, because the problem isn't with a note that is actually in the start segment.
PR updated:
https://github.com/musescore/MuseScore/pull/1879
Also enhanced to skip checks for notes in voices that have been excluded via filter.
Fixed in 6ee06a3a45
Automatically closed -- issue fixed for 2 weeks with no activity.