mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
text/v2: increase the soft limit of the glyph cache if the face is small
Updates #2843
This commit is contained in:
parent
2e60c67ec9
commit
8352be9369
@ -101,7 +101,7 @@ func (g *glyphImageCache) getOrCreate(face Face, key glyphImageCacheKey, create
|
|||||||
// If the number of glyphs exceeds this soft limits, old glyphs are removed.
|
// If the number of glyphs exceeds this soft limits, old glyphs are removed.
|
||||||
// Even after cleaning up the cache, the number of glyphs might still exceed the soft limit, but
|
// Even after cleaning up the cache, the number of glyphs might still exceed the soft limit, but
|
||||||
// this is fine.
|
// this is fine.
|
||||||
const cacheSoftLimit = 512
|
cacheSoftLimit := 128 * glyphVariationCount(face)
|
||||||
if len(g.cache[faceCacheKey]) > cacheSoftLimit {
|
if len(g.cache[faceCacheKey]) > cacheSoftLimit {
|
||||||
for key, e := range g.cache[faceCacheKey] {
|
for key, e := range g.cache[faceCacheKey] {
|
||||||
// 60 is an arbitrary number.
|
// 60 is an arbitrary number.
|
||||||
|
Loading…
Reference in New Issue
Block a user