Justified text now properly handles line breaks

This commit is contained in:
Sasha Koshka 2023-08-07 01:04:43 -04:00
parent ee345c10ef
commit c4dce027ef

View File

@ -99,8 +99,11 @@ func (setter *TypeSetter) needAlignedLayout () {
for index := range setter.lines {
align := setter.align
if index == len(setter.lines) - 1 && align == AlignJustify {
align = AlignLeft
if align == AlignJustify {
except :=
index == len(setter.lines) - 1 ||
setter.lines[index].BreakAfter
if except { align = AlignLeft }
}
setter.lines[index].Align(align)
}