Fix for cursor location with xoffset & flush alignment
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 May 2014 11:59:16 +0000 (21:59 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 May 2014 11:59:16 +0000 (21:59 +1000)
source/blender/blenkernel/intern/font.c

index 88c2b251b9d4dba0729b1ba97e46353ff8ea5991..109d79127ca3728b2e1df97d8c34a4a18c36463d 100644 (file)
@@ -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 */