Skip to content

Commit

Permalink
Fix linebreak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jan 20, 2025
1 parent 2168360 commit 3d81a7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions text/linebreak.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ func (lb *linebreaker) computeAdjustmentRatio(b int, active *Breakpoint) float64
}
ratio := 0.0
if L < lb.width {
//if lb.Y-active.Y == 0.0 {
// // unstretchable line, act as if we have a very small stretchable space.
// // this helps to distinguish between between smaller and longer lines if both would
// // need to stretched beyond the tolerance
// return Infinity * (1.0 + (lb.width-L)/lb.width)
//}
if lb.Y-active.Y == 0.0 {
// unstretchable line, act as if we have a very small stretchable space.
// this helps to distinguish between between smaller and longer lines if both would
// need to stretched beyond the tolerance
return Infinity * (1.0 + (lb.width-L)/lb.width)
}
ratio = (lb.width - L) / (lb.Y - active.Y)
} else if lb.width < L {
ratio = (lb.width - L) / (lb.Z - active.Z)
Expand Down

0 comments on commit 3d81a7d

Please sign in to comment.