- 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)
This commit is contained in:
Campbell Barton
2010-08-01 09:56:00 +00:00
parent 327b4d588b
commit ea6730cdd1
2 changed files with 4 additions and 4 deletions

View File

@@ -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++;

View File

@@ -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);