fix #291569: don't forget to notify views of layout change in line mode

This commit is contained in:
Dmitri Ovodok 2019-12-14 11:29:47 +02:00
parent 43c7d2a359
commit 206a88a116
2 changed files with 5 additions and 6 deletions

View file

@ -4354,6 +4354,7 @@ class CmdStateLocker {
void Score::doLayoutRange(const Fraction& st, const Fraction& et)
{
CmdStateLocker cmdStateLocker(this);
LayoutContext lc(this);
Fraction stick(st);
Fraction etick(et);
@ -4375,7 +4376,6 @@ void Score::doLayoutRange(const Fraction& st, const Fraction& et)
if (etick < Fraction(0,1))
etick = last()->endTick();
LayoutContext lc;
lc.endTick = etick;
_scoreFont = ScoreFont::fontFactory(style().value(Sid::MusicalSymbolFont).toString());
_noteHeadWidth = _scoreFont->width(SymId::noteheadBlack, spatium() / SPATIUM20);
@ -4412,7 +4412,6 @@ void Score::doLayoutRange(const Fraction& st, const Fraction& et)
}
// qDebug("start <%s> tick %d, system %p", m->name(), m->tick(), m->system());
lc.score = m->score();
if (lineMode()) {
lc.prevMeasure = 0;
@ -4493,9 +4492,6 @@ void Score::doLayoutRange(const Fraction& st, const Fraction& et)
lc.curSystem = collectSystem(lc);
lc.layout();
for (MuseScoreView* v : viewer)
v->layoutChanged();
}
//---------------------------------------------------------
@ -4550,5 +4546,8 @@ LayoutContext::~LayoutContext()
{
for (Spanner* s : processedSpanners)
s->layoutSystemsDone();
for (MuseScoreView* v : score->getViewer())
v->layoutChanged();
}
}

View file

@ -48,7 +48,7 @@ struct LayoutContext {
Fraction startTick;
Fraction endTick;
LayoutContext() = default;
LayoutContext(Score* s) : score(s) {}
LayoutContext(const LayoutContext&) = delete;
LayoutContext& operator=(const LayoutContext&) = delete;
~LayoutContext();