Forráskód Böngészése

Merge pull request #6448 from MichalZr6/fix_word_wrapping

Fix word wrapping when there is only one long word
Ivan Savenko 1 hete
szülő
commit
526cbb51ea
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      client/widgets/CComponent.cpp

+ 1 - 1
client/widgets/CComponent.cpp

@@ -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);