Closed Serg-SVM closed 1 month ago
I tried to fix it, but I couldn't think of anything betterđť‚… mscore-slur-lost-properties-fix.zip
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
@zacjansheski pls investigate
Video of behavior in 4.2
https://github.com/musescore/MuseScore/assets/69917893/43fe601b-c906-4d23-941b-59464300fdf2
I can confirm that your code does fix the issue for Mu3
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: 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: 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: 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.
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
Screenshots/Screen recordings
MuseScore Version
3.6.2
Operating system
Linux (Debian 12)