mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:49:40 +00:00
Hack to prevent newlines at the end of books possibly creating unnecessary pages for mygui versions lower than 3.2.2
This commit is contained in:
parent
f87d7c3fce
commit
608e1518a5
1 changed files with 12 additions and 0 deletions
|
@ -197,6 +197,18 @@ namespace MWGui
|
||||||
if (plainText[plainText.size()-1] == '\n')
|
if (plainText[plainText.size()-1] == '\n')
|
||||||
plainText.erase(plainText.end()-1);
|
plainText.erase(plainText.end()-1);
|
||||||
|
|
||||||
|
#if (MYGUI_VERSION < MYGUI_DEFINE_VERSION(3, 2, 2))
|
||||||
|
// splitting won't be fully functional until 3.2.2 (see TextElement::pageSplit())
|
||||||
|
// hack: prevent newlines at the end of the book possibly creating unnecessary pages
|
||||||
|
if (event == BookTextParser::Event_EOF)
|
||||||
|
{
|
||||||
|
while (plainText[plainText.size()-1] == '\n')
|
||||||
|
{
|
||||||
|
plainText.erase(plainText.end()-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TextElement elem(paper, pag, mTextStyle, plainText);
|
TextElement elem(paper, pag, mTextStyle, plainText);
|
||||||
elem.paginate();
|
elem.paginate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue