File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1405,8 +1405,10 @@ void GUIFormSpecMenu::parseLabel(parserData* data, const std::string &element)
1405
1405
std::vector<std::string> lines = split (text, ' \n ' );
1406
1406
1407
1407
for (unsigned int i = 0 ; i != lines.size (); i++) {
1408
- std::wstring wlabel = unescape_translate (unescape_string (
1409
- utf8_to_wide (lines[i])));
1408
+ std::wstring wlabel_colors = translate_string (
1409
+ utf8_to_wide (unescape_string (lines[i])));
1410
+ // Without color escapes to get the font dimensions
1411
+ std::wstring wlabel_plain = unescape_enriched (wlabel_colors);
1410
1412
1411
1413
core::rect<s32> rect;
1412
1414
@@ -1423,7 +1425,7 @@ void GUIFormSpecMenu::parseLabel(parserData* data, const std::string &element)
1423
1425
1424
1426
rect = core::rect<s32>(
1425
1427
pos.X , pos.Y ,
1426
- pos.X + m_font->getDimension (wlabel .c_str ()).Width ,
1428
+ pos.X + m_font->getDimension (wlabel_plain .c_str ()).Width ,
1427
1429
pos.Y + imgsize.Y );
1428
1430
1429
1431
} else {
@@ -1445,13 +1447,13 @@ void GUIFormSpecMenu::parseLabel(parserData* data, const std::string &element)
1445
1447
1446
1448
rect = core::rect<s32>(
1447
1449
pos.X , pos.Y - m_btn_height,
1448
- pos.X + m_font->getDimension (wlabel .c_str ()).Width ,
1450
+ pos.X + m_font->getDimension (wlabel_plain .c_str ()).Width ,
1449
1451
pos.Y + m_btn_height);
1450
1452
}
1451
1453
1452
1454
FieldSpec spec (
1453
1455
" " ,
1454
- wlabel ,
1456
+ wlabel_colors ,
1455
1457
L" " ,
1456
1458
258 +m_fields.size ()
1457
1459
);
You can’t perform that action at this time.
0 commit comments