Skip to content

Commit

Permalink
Fix bug in previous commit, see #257
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Oct 21, 2023
1 parent 98987f2 commit 32ecbe9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions text.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,16 +729,17 @@ func (rt *RichText) ToText(width, height float64, halign, valign TextAlign, inde
glyphs[g].XAdvance += int32(adv*float64(glyphs[g].XAdvance) + 0.5)
}
}
if i == bi {
break
}
width, stretch, shrink = 0.0, 0.0, 0.0
bg2 = ag2
ag2 = bg2 + items[i].Size
} else if items[i].Type == canvasText.GlueType {
width += items[i].Width
stretch += items[i].Stretch
shrink += items[i].Shrink
}
if i < bi {
bg2 += items[i].Size
}
bg2 += items[i].Size
}
}

Expand Down

0 comments on commit 32ecbe9

Please sign in to comment.