Better approximation of emoji's bounds

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

View File

@ -277,7 +277,7 @@ func (gc *GraphicContext) GetStringBounds(s string) (left, top, right, bottom fl
prev, hasPrev := truetype.Index(0), false
for fragment := range gc.Emojis.Iterate(s) {
if fragment.IsEmoji {
cursor += gc.Current.Scale*emojiScale + gc.Current.Scale*emojiSpacing*2
cursor += fUnitsToFloat64(fixed.Int26_6(gc.Current.Scale)) * 1.15
continue
}
index := f.Index(fragment.Rune)