mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Sometimes, optimized line breaking outputs lines that are wider than the allotted width so that spacing between words can be narrowed to fit. However, the width calculation for the fit-to-width case does not account for this, causing the resulting width to exceed the width of the region. This commit takes the minimum of the calculated width with the width of the region. Fixes #1825.