TypeSetter can now do vertical text alignment yay

This commit is contained in:
2023-09-15 15:54:46 -04:00
parent 92cb318972
commit 8d9e0e1340
2 changed files with 50 additions and 13 deletions
+2 -2
View File
@@ -201,8 +201,8 @@ func (line *LineLayout) justify () {
trueContentWidth += word.Width
}
spaceCount := fixed.Int26_6(len(line.Words) - 1)
spacePerWord := (line.Width - trueContentWidth) / spaceCount
spaceCount := len(line.Words) - 1
spacePerWord := (line.Width - trueContentWidth) / fixed.Int26_6(spaceCount)
x := fixed.Int26_6(0)
for index, word := range line.Words {
line.Words[index].X = x