Skip to content

Commit

Permalink
Update usage of go-text typesetting to be compatible with next release
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Feb 19, 2025
1 parent f642bd5 commit 9b4e31f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions widget/richtext.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,10 +1119,12 @@ func truncateLimit(s string, text *canvas.Text, limit int, ellipsis []rune) (int
l.Prepare(conf, runes, shaping.NewSliceIterator(outs))
wrapped, done := l.WrapNextLine(limit)

count := 0
for _, run := range wrapped.Line {
count += run.Runes.Count
count := len(runes)
if wrapped.Truncated != 0 {
count -= wrapped.Truncated
count += len(ellipsis)
}

full := done && count == len(runes)
if !full && len(ellipsis) > 0 {
count--
Expand Down

0 comments on commit 9b4e31f

Please sign in to comment.