From 42a9d27fd925db61be422b9725d8c73802856f56 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 30 Jun 2025 20:40:04 +0100 Subject: [PATCH] Fix: Don't draw truncation ellipsis if it's too wide. (#14401) --- src/gfx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gfx.cpp b/src/gfx.cpp index 646afffcf6..95c53e6b13 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -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;