mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Merge pull request #6448 from MichalZr6/fix_word_wrapping
Fix word wrapping when there is only one long word
This commit is contained in:
@@ -109,7 +109,7 @@ void CComponent::init(ComponentType Type, ComponentSubType Subtype, std::optiona
|
||||
for(std::istringstream iss(s); iss >> s; )
|
||||
longestWordLen = std::max(longestWordLen, fontPtr->getStringWidth(s));
|
||||
|
||||
max = std::max<int>(max, longestWordLen + 8);
|
||||
max = std::min<int>(max, longestWordLen + 8);
|
||||
}
|
||||
|
||||
std::vector<std::string> textLines = CMessage::breakText(getSubtitle(), std::max<int>(max, pos.w), font);
|
||||
|
||||
Reference in New Issue
Block a user