mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Book formatter: Do not insert last page if it's empty, code cleanup
This commit is contained in:
parent
4b1df64fba
commit
f87d7c3fce
@ -233,7 +233,8 @@ namespace MWGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// insert last page
|
// insert last page
|
||||||
pag << Paginator::Page(pag.getStartTop(), pag.getStartTop() + pag.getPageHeight());
|
if (pag.getStartTop() != pag.getCurrentTop())
|
||||||
|
pag << Paginator::Page(pag.getStartTop(), pag.getStartTop() + pag.getPageHeight());
|
||||||
|
|
||||||
paper->setSize(paper->getWidth(), pag.getCurrentTop());
|
paper->setSize(paper->getWidth(), pag.getCurrentTop());
|
||||||
|
|
||||||
@ -301,7 +302,7 @@ namespace MWGui
|
|||||||
mPaginator.setStartTop(newStartTop);
|
mPaginator.setStartTop(newStartTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
mPaginator.modifyCurrentTop(getHeight());
|
mPaginator.setCurrentTop(newTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GraphicElement::pageSplit()
|
int GraphicElement::pageSplit()
|
||||||
|
@ -81,8 +81,6 @@ namespace MWGui
|
|||||||
|
|
||||||
void setStartTop(int top) { mStartTop = top; }
|
void setStartTop(int top) { mStartTop = top; }
|
||||||
void setCurrentTop(int top) { mCurrentTop = top; }
|
void setCurrentTop(int top) { mCurrentTop = top; }
|
||||||
void modifyStartTop(int mod) { mStartTop += mod; }
|
|
||||||
void modifyCurrentTop(int mod) { mCurrentTop += mod; }
|
|
||||||
|
|
||||||
Paginator & operator<<(const Page & page)
|
Paginator & operator<<(const Page & page)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user