diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-31 21:26:09 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-31 21:26:09 +0300 |
commit | 4ae7235637c28f8b5e35825b0052a851b9afe1ae (patch) | |
tree | 4b4eaf3b5b9aeaf6464fdb8efa405a0774c3a90c /source | |
parent | c77870fc78f594411c9831ee77eba2167a702fd7 (diff) |
BLF: Fix Vertical/Horizontal layout switch.
This was breaking the first drawcall after a simple/non-simple shader
switch.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index b029fbe5eeb..e90c2436fd0 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -129,7 +129,7 @@ void blf_batch_draw_begin(FontBLF *font) g_batch.active = g_batch.enabled && simple_shader; - if (g_batch.simple_shader) { + if (simple_shader) { /* Offset is applied to each glyph. */ copy_v2_v2(g_batch.ofs, font->pos); } @@ -156,8 +156,6 @@ void blf_batch_draw_begin(FontBLF *font) blf_batch_draw(); g_batch.simple_shader = simple_shader; g_batch.font = font; - /* Save for next memcmp. */ - memcpy(g_batch.mat, gpumat, sizeof(g_batch.mat)); } else { /* Nothing changed continue batching. */ @@ -166,6 +164,8 @@ void blf_batch_draw_begin(FontBLF *font) if (mat_changed) { gpuPopMatrix(); + /* Save for next memcmp. */ + memcpy(g_batch.mat, gpumat, sizeof(g_batch.mat)); } } else { @@ -378,6 +378,9 @@ static void blf_font_draw_ex( blf_font_ensure_ascii_table(font); blf_font_ensure_ascii_kerning(font, kern_mode); + if (strcmp(str, "Tools") == 0) + printf("AAAA\n"); + blf_batch_draw_begin(font); while ((i < len) && str[i]) { |