[Bf-blender-cvs] [cb27d38] master: BLF: correct ResultBLF.width value when wrapping

Campbell Barton noreply at git.blender.org
Sat Sep 19 07:27:41 CEST 2015


Commit: cb27d38cf4463d0c6928a048773acf4f057d8705
Author: Campbell Barton
Date:   Sat Sep 19 14:45:56 2015 +1000
Branches: master
https://developer.blender.org/rBcb27d38cf4463d0c6928a048773acf4f057d8705

BLF: correct ResultBLF.width value when wrapping

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

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 edb9825..3f3ca78 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -670,6 +670,7 @@ static void blf_font_wrap_apply(
 	size_t i = 0;
 	GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
 	int lines = 0;
+	int pen_x_next = 0;
 
 	BLF_KERNING_VARS(font, has_kerning, kern_mode);
 
@@ -684,7 +685,6 @@ static void blf_font_wrap_apply(
 
 		/* wrap vars */
 		size_t i_curr = i;
-		int pen_x_next;
 		bool do_draw = false;
 
 		BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
@@ -745,7 +745,7 @@ static void blf_font_wrap_apply(
 	if (r_info) {
 		r_info->lines = lines;
 		/* width of last line only (with wrapped lines) */
-		r_info->width = pen_x;
+		r_info->width = pen_x_next;
 	}
 }




More information about the Bf-blender-cvs mailing list