forked from mirror/openmw-tes3mp
Fix a journal layout bug
This commit is contained in:
parent
345ba99c17
commit
78f30e2970
1 changed files with 8 additions and 2 deletions
|
@ -360,10 +360,16 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
|
|||
int spaceLeft = mPageHeight - (curPageStop - curPageStart);
|
||||
int sectionHeight = i->mRect.height ();
|
||||
|
||||
if (sectionHeight <= mPageHeight)
|
||||
// This is NOT equal to i->mRect.height(), which doesn't account for section breaks.
|
||||
int spaceRequired = (i->mRect.bottom - curPageStop);
|
||||
if (curPageStart == curPageStop) // If this is a new page, the section break is not needed
|
||||
spaceRequired = i->mRect.height();
|
||||
|
||||
if (spaceRequired <= mPageHeight)
|
||||
{
|
||||
if (sectionHeight > spaceLeft)
|
||||
if (spaceRequired > spaceLeft)
|
||||
{
|
||||
// The section won't completely fit on the current page. Finish the current page and start a new one.
|
||||
assert (curPageStart != curPageStop);
|
||||
|
||||
mBook->mPages.push_back (Page (curPageStart, curPageStop));
|
||||
|
|
Loading…
Reference in a new issue