Skip to content

Commit

Permalink
properly collapse trailing white spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitkugler authored May 4, 2024
1 parent 94e638b commit 178c3ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shaping/wrapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,13 @@ func (l *LineWrapper) postProcessLine(finalLine Line, done bool) (WrappedLine, b
// zero trailing whitespace advance,
// to be coherent with Output.advanceSpaceAware
if L := len(finalRun.Glyphs); L != 0 {
g := &finalRun.Glyphs[L-1]
if finalRun.Direction.IsVertical() {
if g := &finalRun.Glyphs[L-1]; g.Height == 0 {
if g.Height == 0 {
g.YAdvance = 0
}
} else { // horizontal
if g := finalRun.Glyphs[L-1]; g.Width == 0 {
if g.Width == 0 {
g.XAdvance = 0
}
}
Expand Down

0 comments on commit 178c3ec

Please sign in to comment.