Fix "Copy Attributes -> Font Settings" to copy the new vars (wordspace,
underline stuff) as well. Attempt at fixing editmode undo, but not successful. I'll create a bug- report and assign it to Mika, because I only understand "train station" (German saying :-) when looking at the code.
This commit is contained in:
@@ -1227,15 +1227,17 @@ static void undoFont_to_editFont(void *strv)
|
||||
Curve *cu= G.obedit->data;
|
||||
char *str= strv;
|
||||
|
||||
utf8towchar_(textbuf, str);
|
||||
|
||||
cu->pos= *((short *)str);
|
||||
cu->len= wcslen(textbuf);
|
||||
cu->len= *((short *)(str+2));
|
||||
|
||||
memcpy(textbuf, str+4, cu->len+1);
|
||||
memcpy(textbufinfo, str+4+cu->len+1, cu->len*sizeof(CharInfo));
|
||||
|
||||
memcpy(textbufinfo, str+2+cu->len+1, cu->len*sizeof(CharInfo));
|
||||
cu->selstart = cu->selend = 0;
|
||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||
|
||||
update_string(cu);
|
||||
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
}
|
||||
|
||||
@@ -1244,12 +1246,13 @@ static void *editFont_to_undoFont(void)
|
||||
Curve *cu= G.obedit->data;
|
||||
char *str;
|
||||
|
||||
str= MEM_callocN(MAXTEXT+4+(MAXTEXT+4)*sizeof(CharInfo), "string undo");
|
||||
str= MEM_callocN(MAXTEXT+6+(MAXTEXT+4)*sizeof(CharInfo), "string undo");
|
||||
|
||||
wcs2utf8s(str, textbuf);
|
||||
memcpy(str+4, textbuf, cu->len+1);
|
||||
memcpy(str+4+cu->len+1, textbufinfo, cu->len*sizeof(CharInfo));
|
||||
|
||||
*((short *)str)= cu->pos;
|
||||
memcpy(str+2+cu->len+1, textbufinfo, cu->len*sizeof(CharInfo));
|
||||
*((short *)(str+2))= cu->len;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -2723,6 +2723,9 @@ void copy_attr(short event)
|
||||
cu1->xof= cu->xof;
|
||||
cu1->yof= cu->yof;
|
||||
cu1->textoncurve= cu->textoncurve;
|
||||
cu1->wordspace= cu->wordspace;
|
||||
cu1->ulpos= cu->ulpos;
|
||||
cu1->ulheight= cu->ulheight;
|
||||
if(cu1->vfont) cu1->vfont->id.us--;
|
||||
cu1->vfont= cu->vfont;
|
||||
id_us_plus((ID *)cu1->vfont);
|
||||
|
||||
Reference in New Issue
Block a user