mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
2
base
2
base
Submodule base updated: 3813bb1b95...53ff648336
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user