Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_conversions.c
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| /* ********************* font *************** */ | |||||
| static void createTransFontVerts(TransInfo *t) | |||||
| { | |||||
| Curve *cu = t->obedit->data; | |||||
| TransData *td = NULL; | |||||
| TransData2D *td2d = NULL; | |||||
| TextBox *tb; | |||||
| float mtx[3][3], smtx[3][3]; | |||||
| t->total = 1; | |||||
| td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Font EditMode)"); | |||||
| td2d = t->data2d = MEM_callocN(t->total * sizeof(TransData2D), "TransObData2D(Font EditMode)"); | |||||
| transform_around_single_fallback(t); | |||||
| copy_m3_m4(mtx, t->obedit->obmat); | |||||
| pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON); | |||||
| tb = &cu->tb[cu->actbox -1]; | |||||
| /* center of textbox */ | |||||
| td2d->loc[0] = (cu->xof * cu->fsize) + tb->x + 0.5f * tb->w; | |||||
| td2d->loc[1] = (cu->yof * cu->fsize) + tb->y + cu->fsize - 0.5f * tb->h; | |||||
| td2d->loc[2] = 0.0f; | |||||
| td->loc = td2d->loc; | |||||
| copy_v3_v3(td->iloc, td->loc); | |||||
| copy_v3_v3(td->center, td->loc); | |||||
| td->flag = TD_SELECTED; | |||||
| td->ext = NULL; | |||||
| td->val = NULL; | |||||
| copy_m3_m3(td->smtx, smtx); | |||||
| copy_m3_m3(td->mtx, mtx); | |||||
| } | |||||
| void flushTransFontData(TransInfo *t) | |||||
| { | |||||
| Curve *cu = t->obedit->data; | |||||
| TextBox *tb = &cu->tb[cu->actbox - 1]; | |||||
| tb->x = t->data->loc[0] - (cu->xof * cu->fsize) - 0.5f * tb->w; | |||||
| tb->y = t->data->loc[1] - (cu->yof * cu->fsize) - cu->fsize + 0.5f * tb->h; | |||||
| } | |||||
| /* ********************* lattice *************** */ | /* ********************* lattice *************** */ | ||||
| static void createTransLatticeVerts(TransInfo *t) | static void createTransLatticeVerts(TransInfo *t) | ||||
| Context not available. | |||||
| t->flag &= ~T_PROP_EDIT; | t->flag &= ~T_PROP_EDIT; | ||||
| createTransArmatureVerts(t); | createTransArmatureVerts(t); | ||||
| } | } | ||||
| else if (t->obedit->type == OB_FONT) { | |||||
| createTransFontVerts(t); | |||||
| } | |||||
| else { | else { | ||||
| printf("edit type not implemented!\n"); | printf("edit type not implemented!\n"); | ||||
| } | } | ||||
| Context not available. | |||||