Skip to content

Commit

Permalink
fix #181656: layout glitch after hbox on undo
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Mar 28, 2017
1 parent e2169ed commit a8784d1
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2362,16 +2362,6 @@ bool Score::layoutSystem(qreal& minWidth, qreal systemWidth, bool isFirstSystem,
minWidth -= cautionaryW;
}

//
// remember line breaks in list of measures
//
int n = system->measures().size() - 1;
if (n >= 0) {
for (int i = 0; i < n; ++i)
undoChangeProperty(system->measure(i), P_ID::BREAK_HINT, false);
undoChangeProperty(system->measures().last(), P_ID::BREAK_HINT, true);
}

if (firstMeasure && lastMeasure && firstMeasure != lastMeasure)
removeGeneratedElements(firstMeasure, lastMeasure);

Expand Down Expand Up @@ -2871,6 +2861,21 @@ QList<System*> Score::layoutSystemRow(qreal rowWidth, bool isFirstSystem, bool u
firstInRow = false;
}
//
// remember line breaks in list of measures
//
for (System* system : sl) {
int n = system->measures().size() - 1;
if (n >= 0) {
for (int i = 0; i < n; ++i)
undoChangeProperty(system->measure(i), P_ID::BREAK_HINT, false);
// only set hint for last system in row
if (system == sl.last())
undoChangeProperty(system->measures().last(), P_ID::BREAK_HINT, true);
else
undoChangeProperty(system->measures().last(), P_ID::BREAK_HINT, false);
}
}
//
// dont stretch last system row, if accumulated minWidth is <= lastSystemFillLimit
//
if (curMeasure == 0 && (((rowWidth - ww) / rowWidth) <= styleD(StyleIdx::lastSystemFillLimit)))
Expand Down

0 comments on commit a8784d1

Please sign in to comment.