MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Some properties of slurs and volta's are lost after vertical blocks are removed.

Open Serg-SVM opened this issue 2 years ago • 6 comments

Issue type

UX/Interaction bug (incorrect behaviour)

Bug description

In some cases, when removing horizontal or text blocks, some elements (such as slur and volta) lose some properties (for example, manual position adjustment). The problem is present in versions 3.6.2 and 4.2

Steps to reproduce

  1. Open the example test.zip
  2. Delete the block labeled "Delete me"
  3. The Slur loses the adjustment of its position, Volta resets the "Automatic placement" property

Screenshots/Screen recordings

Shot_2024-01-05_13-29-58 Shot_2024-01-05_13-30-20

MuseScore Version

3.6.2

Operating system

Linux (Debian 12)

Serg-SVM avatar Jan 05 '24 11:01 Serg-SVM

I tried to fix it, but I couldn't think of anything better𝂅 mscore-slur-lost-properties-fix.zip

Serg-SVM avatar Jan 09 '24 13:01 Serg-SVM

Your patch, but easily visible and readable ;-) :

--- a/libmscore/layout.cpp
+++ b/libmscore/layout.cpp
@@ -3779,6 +3779,8 @@ System* Score::collectSystem(LayoutContext& lc)
       bool curHeader = lc.curMeasure->header();
       bool curTrailer = lc.curMeasure->trailer();
 
+      QList<System *> brokenSystems;
+
       while (lc.curMeasure) {    // collect measure for system
             System* oldSystem = lc.curMeasure->system();
             system->appendMeasure(lc.curMeasure);
@@ -3850,6 +3852,10 @@ System* Score::collectSystem(LayoutContext& lc)
                         }
                   }
 
+            if (oldSystem && system != oldSystem && !brokenSystems.contains(oldSystem) && lc.systemList.contains(oldSystem)) {
+                  brokenSystems.append(oldSystem);
+                  }
+
             if (lc.prevMeasure && lc.prevMeasure->isMeasure() && lc.prevMeasure->system() == system) {
                   //
                   // now we know that the previous measure is not the last
@@ -4065,6 +4071,10 @@ System* Score::collectSystem(LayoutContext& lc)
             }
       system->setWidth(pos.x());
 
+      for(System *system : brokenSystems) {
+            system->clear();
+            }
+
       layoutSystemElements(system, lc);
       system->layout2();   // compute staff distances
       // TODO: now that the code at the top of this function does this same backwards search,

This patch would only apply to Mu3 though

Jojo-Schmitz avatar Jan 09 '24 14:01 Jojo-Schmitz

@zacjansheski pls investigate

bkunda avatar Jan 09 '24 14:01 bkunda

Video of behavior in 4.2

https://github.com/musescore/MuseScore/assets/69917893/43fe601b-c906-4d23-941b-59464300fdf2

zacjansheski avatar Jan 09 '24 17:01 zacjansheski

I can confirm that your code does fix the issue for Mu3

Jojo-Schmitz avatar Jan 09 '24 20:01 Jojo-Schmitz

I have observed this issue with other elements as well, such as "Text lines" and hairpins. The behavior is very inconsistent and doesn't seem to only happen when frames are added/removed, but perhaps when other layout changes are applied as well, such as changing the number of measures on a system. I was able to reproduce it once with this "Text line" element by inserting and immediately removing a vertical frame on the measure shown: image But I wasn't able to get it to happen a second time. Interestingly, the layout seemed to change after adding and removing the frame, since this is how it looked beforehand. Note how some of the elements have "Auto-place" enabled: autoplace2 This is a reproduction of how it looked after the error. Observe now that ALL the elements have "Auto-place" enabled, which seems to have turned itself on: autoplace1 The last screenshot actually happened earlier while I was editing a completely different section of the score. I recall modifying (but not removing) the text frame containing the score title before this happened. I suspect that it might also have happened after I made changes to the number of measures on certain systems by using the "Group measures" property.

Panogen avatar Jan 21 '24 22:01 Panogen