From a31abf79de147e8052920f2c006af4ec0e88fa37 Mon Sep 17 00:00:00 2001 From: poire-z Date: Sat, 4 Jan 2020 01:18:48 +0100 Subject: [PATCH] TextBoxWidget: fix some truncation ellipsis issues Ellipsis was sometimes not displayed when text is right aligned, because width was not updated with ellipsis size. bump base/xtext: fix truncation ellipsis position in bidi text so it stays nearer to previous logical order char, instead of sometimes being thrown away to start or end of line. --- base | 2 +- frontend/ui/widget/textboxwidget.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/base b/base index 3813bb1b9..53ff64833 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 3813bb1b950abdd75a11b96e237ca9932f3dc1a5 +Subproject commit 53ff64833621a1d85c04111ac7c05094f585fe0d diff --git a/frontend/ui/widget/textboxwidget.lua b/frontend/ui/widget/textboxwidget.lua index 6acd0c6e7..b1017aac0 100644 --- a/frontend/ui/widget/textboxwidget.lua +++ b/frontend/ui/widget/textboxwidget.lua @@ -665,7 +665,8 @@ function TextBoxWidget:_renderText(start_row_idx, end_row_idx) -- Requested to add an ellipsis on this line local ellipsis_width = RenderText:getEllipsisWidth(self.face) -- no bold: xtext does synthetized bold with normal metrics - if line.width + ellipsis_width > line.targeted_width then + line.width = line.width + ellipsis_width + if line.width > line.targeted_width then -- The ellipsis would overflow: we need to re-makeLine() -- this line with a smaller targeted_width line = self._xtext:makeLine(line.offset, line.targeted_width - ellipsis_width)