[Bf-blender-cvs] [4725941] master: Fix for cursor location with xoffset & flush alignment

Campbell Barton noreply at git.blender.org
Thu May 15 14:01:08 CEST 2014


Commit: 4725941f2338e1b2a919f1dafd00ff283a47766a
Author: Campbell Barton
Date:   Thu May 15 21:59:16 2014 +1000
https://developer.blender.org/rB4725941f2338e1b2a919f1dafd00ff283a47766a

Fix for cursor location with xoffset & flush alignment

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

M	source/blender/blenkernel/intern/font.c

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

diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 88c2b25..109d791 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -822,9 +822,12 @@ makebreak:
 			}
 		}
 		else if ((cu->spacemode == CU_FLUSH) && (cu->tb[0].w != 0.0f)) {
-			for (i = 0; i < lnr; i++)
-				if (linedata2[i] > 1)
-					linedata[i] = ((linedata3[i] - linedata[i]) + cu->xof) / (linedata2[i] - 1);
+			for (i = 0; i < lnr; i++) {
+				linedata[i] = ((linedata3[i] - linedata[i]) + cu->xof);
+				if (linedata2[i] > 1) {
+					linedata[i] /= (linedata2[i] - 1);
+				}
+			}
 			for (i = 0; i <= slen; i++) {
 				for (j = i; (!ELEM(mem[j], '\0', '\n')) && (chartransdata[j].dobreak == 0) && (j < slen); j++) {
 					/* do nothing */




More information about the Bf-blender-cvs mailing list