mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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 {
|
||||
|
@ -338,9 +338,10 @@ func (g *GoTextFace) glyphImage(glyph glyph, origin fixed.Point26_6) (*ebiten.Im
|
||||
Y: (origin.Y + b.Min.Y) & ((1 << 6) - 1),
|
||||
}
|
||||
key := glyphImageCacheKey{
|
||||
id: uint32(glyph.shapingGlyph.GlyphID),
|
||||
xoffset: subpixelOffset.X,
|
||||
yoffset: subpixelOffset.Y,
|
||||
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