Split measure shifts folllowing slurs present in the score.

• Oct 9, 2013 - 11:33
Type
Functional
Severity
S4 - Minor
Status
closed
Project
Tags

Watch what happens to the slurs in this score when the first bar is split at the first rest

http://www.screenr.com/MjLH

Not good :(

Windows 8 Pro
MuseScore 2 commit 2b0d24d


Comments

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 :)

Title 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).