change Text.LineHeight to use actual units instead of scale (such as 1.5)

This commit is contained in:
faiface 2017-05-03 23:57:09 +02:00
parent 48f3d5cb3e
commit 91448dcd68
1 changed files with 3 additions and 3 deletions

View File

@ -64,8 +64,8 @@ func New(face font.Face, runeSets ...[]rune) *Text {
txt := &Text{ txt := &Text{
atlas: atlas, atlas: atlas,
color: pixel.Alpha(1), color: pixel.Alpha(1),
lineHeight: 1, lineHeight: atlas.LineHeight(),
tabWidth: atlas.mapping[' '].Advance * 4, tabWidth: atlas.Glyph(' ').Advance * 4,
} }
txt.glyph.SetLen(6) txt.glyph.SetLen(6)
txt.d.Picture = txt.atlas.pic txt.d.Picture = txt.atlas.pic
@ -155,7 +155,7 @@ func (txt *Text) WriteRune(r rune) (n int, err error) {
switch r { switch r {
case '\n': 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()) txt.Dot = txt.Dot.WithX(txt.Orig.X())
return return
case '\r': case '\r':