浏览代码

Merge pull request #6448 from MichalZr6/fix_word_wrapping

Fix word wrapping when there is only one long word
Ivan Savenko 1 周之前
父节点
当前提交
526cbb51ea
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);