The shift to a different note is even more evident when a hairpin is used instead of a slur.
I think this bug affects most spanners (but probably not the ties).
1. Create a score of four bars with any time signature.
2. Add some notes to each bar then add slurs to them.
3. Use the split measure function on the first bar and see what happens :)
Split measure nerfs any slurs present in the score.
⇒
Split measure shifts folllowing slurs present in the score.
Status (old)
needs info
⇒
active
I managed to find where the problem originates.
In libmscore\splitMeasure.cpp the code performs the steps:
- line34 deleteItem(measure); this shifts all following spanners by -x, where x is the length (in ticks) of the measure;
- line37 Measure* m2 = static_cast<Measure*>(insertMeasure(Element::MEASURE, measure->next(), true)); this shifts all following spanners by +y, where y is the length (in ticks) of the inserted measure; it is the length given by the time signature of the measure before the one being deleted (or the time signature of the following one if the measure being deleted is the first in the score);
- line 38 Measure* m1 = static_cast<Measure*>(insertMeasure(Element::MEASURE, m2, true)); this shifts all following spanners by +y.
- line 50 range.fixup(m1); this piece of code, introduced by Marc Sabatella in [eec88fd4c], adjusts all spanners starting inside the measure being split, but all other spanners are left as they are.
Therefore, in summary, all following spanners (except the one starting in the measure being split) are shifted by 2y-x; for example, if there are no time signature changes they are shifted to the right by a whole measure (in this case y=x and -x+2x=+x).
Comments
What should we see? Can you give a small sample file and steps to reproduce?
The slur moves to a different measure. Had to look at it several times to notice :-)
Doublepost...
The shift to a different note is even more evident when a hairpin is used instead of a slur.
I think this bug affects most spanners (but probably not the ties).
Possibly related: #21721: Spanners not properly deleted when corresponding anchoring notes are deleted
Steps to reproduce:-
1. Create a score of four bars with any time signature.
2. Add some notes to each bar then add slurs to them.
3. Use the split measure function on the first bar and see what happens :)
I managed to find where the problem originates.
In libmscore\splitMeasure.cpp the code performs the steps:
- line34
deleteItem(measure);
this shifts all following spanners by -x, where x is the length (in ticks) of the measure;- line37
Measure* m2 = static_cast<Measure*>(insertMeasure(Element::MEASURE, measure->next(), true));
this shifts all following spanners by +y, where y is the length (in ticks) of the inserted measure; it is the length given by the time signature of the measure before the one being deleted (or the time signature of the following one if the measure being deleted is the first in the score);- line 38
Measure* m1 = static_cast<Measure*>(insertMeasure(Element::MEASURE, m2, true));
this shifts all following spanners by +y.- line 50
range.fixup(m1);
this piece of code, introduced by Marc Sabatella in [eec88fd4c], adjusts all spanners starting inside the measure being split, but all other spanners are left as they are.Therefore, in summary, all following spanners (except the one starting in the measure being split) are shifted by 2y-x; for example, if there are no time signature changes they are shifted to the right by a whole measure (in this case y=x and -x+2x=+x).
Fixed in 68afea77ab
Automatically closed -- issue fixed for 2 weeks with no activity.