Skip to content

Commit

Permalink
fix #291569: don't forget to notify views of layout change in line mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrio95 committed Dec 14, 2019
1 parent 43c7d2a commit 206a88a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

//---------------------------------------------------------
Expand Down Expand Up @@ -4550,5 +4546,8 @@ LayoutContext::~LayoutContext()
{
for (Spanner* s : processedSpanners)
s->layoutSystemsDone();

for (MuseScoreView* v : score->getViewer())
v->layoutChanged();
}
}
2 changes: 1 addition & 1 deletion libmscore/layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 206a88a

Please sign in to comment.