1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

fixing trimming color in object list

This commit is contained in:
Laserlicht
2025-09-28 20:25:59 +02:00
parent 99462e540b
commit 70328f1bd9

View File

@@ -1668,6 +1668,8 @@ void CObjectListWindow::trimTextIfTooWide(std::string & text, int id) const
{ {
int maxWidth = pos.w - 60; // 60 px for scrollbar and borders int maxWidth = pos.w - 60; // 60 px for scrollbar and borders
std::string idStr = '(' + std::to_string(id) + ')'; std::string idStr = '(' + std::to_string(id) + ')';
if(text[0] == '{')
idStr = '}' + idStr;
const auto & font = ENGINE->renderHandler().loadFont(FONT_SMALL); const auto & font = ENGINE->renderHandler().loadFont(FONT_SMALL);
std::string suffix = " ... " + idStr; std::string suffix = " ... " + idStr;