Fixed TypeSetter.AtPosition

This commit is contained in:
2023-08-06 03:37:08 -04:00
parent c207eadfb8
commit 6407baed13
2 changed files with 19 additions and 15 deletions
+11
View File
@@ -155,6 +155,17 @@ func DoLine (text []rune, face font.Face, wrap bool, maxWidth fixed.Int26_6) (li
return
}
// Length returns the amount of runes within the line, including the trailing
// line break if it exists.
func (line *LineLayout) Length () int {
lineSize := 0
for _, word := range line.Words {
lineSize += len(word.Runes)
}
if line.BreakAfter { lineSize ++ }
return lineSize
}
// Align aligns the text in the line according to the specified alignment
// method.
func (line *LineLayout) Align (align Align) {