Merge pull request #6448 from MichalZr6/fix_word_wrapping

Fix word wrapping when there is only one long word
This commit is contained in:
Ivan Savenko
2025-12-14 22:12:36 +02:00
committed by GitHub
+1 -1
View File
@@ -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);