From 91448dcd686aa9dad247bd0995976236172800cb Mon Sep 17 00:00:00 2001 From: faiface Date: Wed, 3 May 2017 23:57:09 +0200 Subject: [PATCH] change Text.LineHeight to use actual units instead of scale (such as 1.5) --- text/text.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/text/text.go b/text/text.go index 739ca32..ddc09db 100644 --- a/text/text.go +++ b/text/text.go @@ -64,8 +64,8 @@ func New(face font.Face, runeSets ...[]rune) *Text { txt := &Text{ atlas: atlas, color: pixel.Alpha(1), - lineHeight: 1, - tabWidth: atlas.mapping[' '].Advance * 4, + lineHeight: atlas.LineHeight(), + tabWidth: atlas.Glyph(' ').Advance * 4, } txt.glyph.SetLen(6) txt.d.Picture = txt.atlas.pic @@ -155,7 +155,7 @@ func (txt *Text) WriteRune(r rune) (n int, err error) { switch r { case '\n': - txt.Dot -= pixel.Y(txt.atlas.lineHeight * txt.lineHeight) + txt.Dot -= pixel.Y(txt.lineHeight) txt.Dot = txt.Dot.WithX(txt.Orig.X()) return case '\r':