Should fix centering issues with trailing emojis

This commit is contained in:
Hamcha 2018-11-16 17:13:49 +01:00
parent 9dbc14edd6
commit 41b8d7304e
Signed by: hamcha
GPG Key ID: A40413D21021EAEE
1 changed files with 2 additions and 0 deletions

View File

@ -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)