From 3eb444f2110c7f297725a6edfa7c106eedc2849f Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 12 Nov 2021 00:17:51 +0900 Subject: [PATCH] text: Refactoring --- text/text.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/text.go b/text/text.go index 3381d4643..57eaab7cb 100644 --- a/text/text.go +++ b/text/text.go @@ -58,9 +58,9 @@ func drawGlyph(dst *ebiten.Image, face font.Face, r rune, img *ebiten.Image, dx, op2 := &ebiten.DrawImageOptions{} if op != nil { *op2 = *op + op2.GeoM.Reset() } - op2.GeoM.Reset() - op2.GeoM.Translate(float64((dx+b.Min.X)>>6), float64((dy+b.Min.Y)>>6)) + op2.GeoM.Translate(math.Floor(fixed26_6ToFloat64(dx+b.Min.X)), math.Floor(fixed26_6ToFloat64(dy+b.Min.Y))) if op != nil { op2.GeoM.Concat(op.GeoM) }