From 41b8d7304eca74678cbe683d7f10616b0d55a12d Mon Sep 17 00:00:00 2001 From: Hamcha Date: Fri, 16 Nov 2018 17:13:49 +0100 Subject: [PATCH] Should fix centering issues with trailing emojis --- draw2dimg/ftgc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/draw2dimg/ftgc.go b/draw2dimg/ftgc.go index 8359480..ce4ca77 100644 --- a/draw2dimg/ftgc.go +++ b/draw2dimg/ftgc.go @@ -278,6 +278,8 @@ func (gc *GraphicContext) GetStringBounds(s string) (left, top, right, bottom fl for fragment := range gc.Emojis.Iterate(s) { if fragment.IsEmoji { cursor += fUnitsToFloat64(fixed.Int26_6(gc.Current.Scale)) * 1.15 + left = math.Min(left, cursor) + right = math.Max(right, cursor) continue } index := f.Index(fragment.Rune)