1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-23 06:29:11 +00:00

Fix: Don't draw truncation ellipsis if it's too wide. (#14401)

This commit is contained in:
2025-06-30 20:40:04 +01:00
committed by GitHub
parent 80d2194511
commit 42a9d27fd9

View File

@@ -540,6 +540,9 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left,
dot_width = fc->GetGlyphWidth(dot_glyph);
dot_sprite = fc->GetGlyph(dot_glyph);
/* Is there enough space even for an ellipsis? */
if (max_w < dot_width * 3) return (_current_text_dir == TD_RTL) ? left : right;
if (_current_text_dir == TD_RTL) {
min_x += 3 * dot_width;
offset_x = w - max_w;