Fix T74228, T74246: Strange Characters
The glyph can come from a different cache.
This commit is contained in:
@@ -461,7 +461,7 @@ void blf_glyph_render(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, fl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g->cached) {
|
if (g->glyph_cache == NULL) {
|
||||||
if (font->tex_size_max == -1) {
|
if (font->tex_size_max == -1) {
|
||||||
font->tex_size_max = GPU_max_texture_size();
|
font->tex_size_max = GPU_max_texture_size();
|
||||||
}
|
}
|
||||||
@@ -492,7 +492,7 @@ void blf_glyph_render(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, fl
|
|||||||
gc->bitmap_len = bitmap_len;
|
gc->bitmap_len = bitmap_len;
|
||||||
|
|
||||||
gc->glyphs_len_free--;
|
gc->glyphs_len_free--;
|
||||||
g->cached = true;
|
g->glyph_cache = gc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (font->flags & BLF_CLIPPING) {
|
if (font->flags & BLF_CLIPPING) {
|
||||||
@@ -505,8 +505,10 @@ void blf_glyph_render(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, fl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_batch.glyph_cache = gc;
|
if (g_batch.glyph_cache != g->glyph_cache) {
|
||||||
BLI_assert(g->offset < gc->bitmap_len);
|
blf_batch_draw();
|
||||||
|
g_batch.glyph_cache = g->glyph_cache;
|
||||||
|
}
|
||||||
|
|
||||||
if (font->flags & BLF_SHADOW) {
|
if (font->flags & BLF_SHADOW) {
|
||||||
rctf rect_ofs;
|
rctf rect_ofs;
|
||||||
|
@@ -131,7 +131,7 @@ typedef struct GlyphBLF {
|
|||||||
float pos_x;
|
float pos_x;
|
||||||
float pos_y;
|
float pos_y;
|
||||||
|
|
||||||
bool cached;
|
struct GlyphCacheBLF *glyph_cache;
|
||||||
} GlyphBLF;
|
} GlyphBLF;
|
||||||
|
|
||||||
typedef struct FontBufInfoBLF {
|
typedef struct FontBufInfoBLF {
|
||||||
|
Reference in New Issue
Block a user