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.
This commit is contained in:
poire-z
2020-01-04 01:18:48 +01:00
parent 143c7e4131
commit a31abf79de
2 changed files with 3 additions and 2 deletions

2
base

Submodule base updated: 3813bb1b95...53ff648336

View File

@@ -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)