Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #278865, fix #279521: reuse system elements layout code in linear mode #4332

Merged
merged 1 commit into from Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 17 additions & 13 deletions libmscore/layout.cpp
Expand Up @@ -3239,10 +3239,24 @@ System* Score::collectSystem(LayoutContext& lc)
}
system->setWidth(pos.x());

//#############################################################
// layout system elements
//#############################################################
layoutSystemElements(system, lc);
system->layout2(); // compute staff distances

lm = system->lastMeasure();
if (lm) {
lc.firstSystem = lm->sectionBreak() && _layoutMode != LayoutMode::FLOAT;
lc.startWithLongNames = lc.firstSystem && lm->sectionBreakElement()->startWithLongNames();
}

return system;
}

//---------------------------------------------------------
// layoutSystemElements
//---------------------------------------------------------

void Score::layoutSystemElements(System* system, LayoutContext& lc)
{
//-------------------------------------------------------------
// create cr segment list to speed up computations
//-------------------------------------------------------------
Expand Down Expand Up @@ -3541,16 +3555,6 @@ System* Score::collectSystem(LayoutContext& lc)
e->layout();
}
}

system->layout2(); // compute staff distances

lm = system->lastMeasure();
if (lm) {
lc.firstSystem = lm->sectionBreak() && _layoutMode != LayoutMode::FLOAT;
lc.startWithLongNames = lc.firstSystem && lm->sectionBreakElement()->startWithLongNames();
}

return system;
}

//---------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions libmscore/layoutlinear.cpp
Expand Up @@ -204,6 +204,7 @@ void LayoutContext::layoutLinear()
{
System* system = score->systems().front();

#if 0 // replaced by layoutSystemElements()
//
// layout
// - beams
Expand Down Expand Up @@ -407,6 +408,9 @@ void LayoutContext::layoutLinear()
continue;
sp->layoutSystem(system);
}
#endif

score->layoutSystemElements(system, *this);

system->layout2(); // compute staff distances

Expand Down
1 change: 1 addition & 0 deletions libmscore/score.h
Expand Up @@ -583,6 +583,7 @@ class Score : public QObject, public ScoreElement {
void setExcerpt(Excerpt* e) { _excerpt = e; }

System* collectSystem(LayoutContext&);
void layoutSystemElements(System* system, LayoutContext& lc);
void getNextMeasure(LayoutContext&); // get next measure for layout

void cmdRemovePart(Part*);
Expand Down