mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
text/v2: add variations to glyph cache keys
This commit is contained in:
parent
c7843a4e2b
commit
68d5fa46e2
@ -50,6 +50,8 @@ type glyphImageCacheKey struct {
|
||||
|
||||
xoffset fixed.Int26_6
|
||||
yoffset fixed.Int26_6
|
||||
|
||||
variations string
|
||||
}
|
||||
|
||||
type glyphImageCacheEntry struct {
|
||||
|
@ -341,6 +341,7 @@ func (g *GoTextFace) glyphImage(glyph glyph, origin fixed.Point26_6) (*ebiten.Im
|
||||
id: uint32(glyph.shapingGlyph.GlyphID),
|
||||
xoffset: subpixelOffset.X,
|
||||
yoffset: subpixelOffset.Y,
|
||||
variations: g.ensureVariationsString(),
|
||||
}
|
||||
img := theGlyphImageCache.getOrCreate(g, key, func() *ebiten.Image {
|
||||
return segmentsToImage(glyph.scaledSegments, subpixelOffset, b)
|
||||
|
Loading…
Reference in New Issue
Block a user