bugfix [#23923] extra material slots created

This commit is contained in:
Campbell Barton
2010-09-21 06:09:14 +00:00
parent e2adc92341
commit cf4f9d2c19
2 changed files with 4 additions and 11 deletions

View File

@@ -236,10 +236,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c)
ef->textbuf[cu->pos]= c;
ef->textbufinfo[cu->pos] = cu->curinfo;
ef->textbufinfo[cu->pos].kern = 0;
if(obedit->actcol>0)
ef->textbufinfo[cu->pos].mat_nr = obedit->actcol;
else
ef->textbufinfo[cu->pos].mat_nr = 0;
ef->textbufinfo[cu->pos].mat_nr = obedit->actcol;
cu->pos++;
cu->len++;
@@ -257,14 +254,10 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re
{
Curve *cu= obedit->data;
EditFont *ef= cu->editfont;
if(cu->pos)
cu->curinfo = ef->textbufinfo[cu->pos-1];
else
cu->curinfo = ef->textbufinfo[0];
cu->curinfo = ef->textbufinfo[cu->pos?cu->pos-1:0];
if(obedit->totcol>0)
obedit->actcol= ef->textbufinfo[cu->pos-1].mat_nr;
obedit->actcol= ef->textbufinfo[cu->pos?cu->pos-1:0].mat_nr;
update_string(cu);
BKE_text_to_curve(scene, obedit, mode);

View File

@@ -141,7 +141,7 @@ typedef struct Nurb {
typedef struct CharInfo {
short kern;
short mat_nr;
short mat_nr; /* index start at 1, unlike mesh & nurbs */
char flag;
char pad;
short pad2;