Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-01 13:56:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-01 13:56:00 +0400
commitea6730cdd1f3ad77d6cd9ba511b1c632ef225542 (patch)
tree7921658a8b3a944215b049202206542fd2a44bb1 /source
parent327b4d588bf87c2f3aa5dc3891a75ade7f55d737 (diff)
- font object x/yoffset was making text box's wrap text incorrectly.
- draw text boxes with the offset applied. (abologies for making font.c even more confusing)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/font.c4
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 7ebd0c3f457..46f67adeb4b 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -814,7 +814,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
twidth = char_width(cu, che, info);
// Calculate positions
- if((tb->w != 0.0) && (ct->dobreak==0) && ((xof-(tb->x/cu->fsize)+twidth)*cu->fsize) > tb->w) {
+ if((tb->w != 0.0) && (ct->dobreak==0) && ((xof-(tb->x/cu->fsize)+twidth)*cu->fsize) > tb->w + cu->xof*cu->fsize) {
// fprintf(stderr, "linewidth exceeded: %c%c%c...\n", mem[i], mem[i+1], mem[i+2]);
for (j=i; j && (mem[j] != '\n') && (mem[j] != '\r') && (chartransdata[j].dobreak==0); j--) {
if (mem[j]==' ' || mem[j]=='-') {
@@ -855,7 +855,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
linedata4[lnr]= wsnr;
if ( (tb->h != 0.0) &&
- ((-(yof-(tb->y/cu->fsize))) > ((tb->h/cu->fsize)-(linedist*cu->fsize))) &&
+ ((-(yof-(tb->y/cu->fsize))) > ((tb->h/cu->fsize)-(linedist*cu->fsize)) - cu->yof) &&
(cu->totbox > (curbox+1)) ) {
maxlen= 0;
tb++;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 02a8709a1ac..9d0c5bcd898 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5802,8 +5802,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
UI_ThemeColor(TH_ACTIVE);
else
UI_ThemeColor(TH_WIRE);
- vec1[0] = cu->tb[i].x;
- vec1[1] = cu->tb[i].y + cu->fsize;
+ vec1[0] = (cu->xof * cu->fsize) + cu->tb[i].x;
+ vec1[1] = (cu->yof * cu->fsize) + cu->tb[i].y + cu->fsize;
vec1[2] = 0.001;
glBegin(GL_LINE_STRIP);
glVertex3fv(vec1);