fix #42891: lyrics run off bottom of page

This commit is contained in:
Marc Sabatella 2015-03-09 15:07:13 -06:00
parent 689fad5a36
commit dfaef4d217

View file

@ -3357,7 +3357,7 @@ PAGEDBG(" system %d", i);
bmargin = vbox->bottomGap();
tmargin = vbox->topGap();
if (pC.lastSystem) {
if (pC.lastSystem->isVbox())
if (pC.lastSystem->isVbox())
tmargin += pC.lastSystem->vbox()->bottomGap();
else
tmargin += systemFrameDistance;
@ -3475,6 +3475,15 @@ void Score::layoutPage(const PageContext& pC, qreal d)
return;
}
// allow room for lyrics on last staff of last system
// these are not included in system height or in previous margin calculations
// but they are accounted for in prevDist
int lastStaffIdx = nstaves() - 1;
if (!pC.lastSystem->isVbox() && staff(lastStaffIdx)->show() && pC.lastSystem->staff(lastStaffIdx)->show()) {
if (pC.prevDist > pC.slb)
restHeight -= pC.prevDist - pC.slb;
}
const qreal maxStretch = styleP(StyleIdx::maxSystemDistance) - styleP(StyleIdx::minSystemDistance);
QList<System*> slist;