ui/text: rename Center Alignment to Middle and drop IsNewline

Middle matches the similar layout.Middle constant, and IsNewline is
too simple to export.

Add documentation while we're here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-11 19:25:50 +02:00
parent 628a97cd71
commit 2f9ac5aebb
4 changed files with 44 additions and 16 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ func layoutText(ppem fixed.Int26_6, str string, f *opentype, opts text.LayoutOpt
}
for prev.idx < len(str) {
c, s := utf8.DecodeRuneInString(str[prev.idx:])
nl := text.IsNewline(c)
nl := c == '\n'
if opts.SingleLine && nl {
nl = false
c = ' '