1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Do not attempt to resize text box to zero-width

This commit is contained in:
Ivan Savenko
2023-11-26 18:55:50 +02:00
parent 560a1231a6
commit 81a48f2d80
3 changed files with 9 additions and 1 deletions

View File

@@ -120,6 +120,10 @@ SDL_Surface * CMessage::drawDialogBox(int w, int h, PlayerColor playerColor)
std::vector<std::string> CMessage::breakText( std::string text, size_t maxLineWidth, EFonts font )
{
assert(maxLineWidth != 0);
if (maxLineWidth == 0)
return { text };
std::vector<std::string> ret;
boost::algorithm::trim_right_if(text,boost::algorithm::is_any_of(std::string(" ")));