Skip to content

Commit 5bc7fc4

Browse files
authored
Merge pull request #1758 from Tyriar/1757_cjk_glyph_key
Move dynamic atlas canCache check higher
2 parents af0ca6c + 3edd2f2 commit 5bc7fc4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/renderer/atlas/DynamicCharAtlas.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,17 @@ export default class DynamicCharAtlas extends BaseCharAtlas {
129129
return true;
130130
}
131131

132+
// Exit early for uncachable glyphs
133+
if (!this._canCache(glyph)) {
134+
return false;
135+
}
136+
132137
const glyphKey = getGlyphCacheKey(glyph);
133138
const cacheValue = this._cacheMap.get(glyphKey);
134139
if (cacheValue !== null && cacheValue !== undefined) {
135140
this._drawFromCache(ctx, cacheValue, x, y);
136141
return true;
137-
} else if (this._canCache(glyph) && this._drawToCacheCount < FRAME_CACHE_DRAW_LIMIT) {
142+
} else if (this._drawToCacheCount < FRAME_CACHE_DRAW_LIMIT) {
138143
let index;
139144
if (this._cacheMap.size < this._cacheMap.capacity) {
140145
index = this._cacheMap.size;

0 commit comments

Comments
 (0)