From 3b599e70ec9947a7942791a8f82cad766dd165f2 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Sat, 22 Aug 2020 15:31:07 +0200 Subject: [PATCH] Fix text anchor position when txt.Bounds().W() != txt.Dot.X-txt.Orig.X --- text/text.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/text.go b/text/text.go index c6e73175..84365c24 100644 --- a/text/text.go +++ b/text/text.go @@ -252,7 +252,7 @@ func (txt *Text) DrawColorMask(t pixel.Target, matrix pixel.Matrix, mask color.C txt.dirty = true } - offset := txt.Bounds().AnchorPos(txt.anchor) + offset := txt.Orig.Sub(txt.Bounds().Max.Add(txt.Bounds().AnchorPos(txt.anchor.Opposite()))) txt.mat = pixel.IM.Moved(offset).Chained(txt.mat) if mask == nil {