[Bf-blender-cvs] [4ae7235637c] blender2.8: BLF: Fix Vertical/Horizontal layout switch.

Clément Foucault noreply at git.blender.org
Sat Mar 31 20:26:33 CEST 2018


Commit: 4ae7235637c28f8b5e35825b0052a851b9afe1ae
Author: Clément Foucault
Date:   Sat Mar 31 20:26:09 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4ae7235637c28f8b5e35825b0052a851b9afe1ae

BLF: Fix Vertical/Horizontal layout switch.

This was breaking the first drawcall after a simple/non-simple shader
switch.

===================================================================

M	source/blender/blenfont/intern/blf_font.c

===================================================================

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]) {



More information about the Bf-blender-cvs mailing list