Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/vfont.c
| Show First 20 Lines • Show All 1,416 Lines • ▼ Show 20 Lines | if (cu->textoncurve && cu->textoncurve->type == OB_CURVES_LEGACY) { | ||||
| } | } | ||||
| } | } | ||||
| if (selboxes) { | if (selboxes) { | ||||
| ct = chartransdata; | ct = chartransdata; | ||||
| for (i = 0; i <= selend; i++, ct++) { | for (i = 0; i <= selend; i++, ct++) { | ||||
| if (i >= selstart) { | if (i >= selstart) { | ||||
| selboxes[i - selstart].x = ct->xof * font_size; | selboxes[i - selstart].x = ct->xof * font_size; | ||||
| selboxes[i - selstart].y = ct->yof * font_size; | selboxes[i - selstart].y = (ct->yof - 0.25f) * font_size; | ||||
| selboxes[i - selstart].h = font_size; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (ELEM(mode, FO_CURSUP, FO_CURSDOWN, FO_PAGEUP, FO_PAGEDOWN) && | if (ELEM(mode, FO_CURSUP, FO_CURSDOWN, FO_PAGEUP, FO_PAGEDOWN) && | ||||
| iter_data->status == VFONT_TO_CURVE_INIT) { | iter_data->status == VFONT_TO_CURVE_INIT) { | ||||
| ct = &chartransdata[ef->pos]; | ct = &chartransdata[ef->pos]; | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (ef) { | ||||
| float si, co; | float si, co; | ||||
| ct = &chartransdata[ef->pos]; | ct = &chartransdata[ef->pos]; | ||||
| si = sinf(ct->rot); | si = sinf(ct->rot); | ||||
| co = cosf(ct->rot); | co = cosf(ct->rot); | ||||
| f = ef->textcurs[0]; | f = ef->textcurs[0]; | ||||
| f[0] = font_size * (-0.1f * co + ct->xof); | f[0] = font_size * (-0.02f * co + ct->xof); | ||||
| f[1] = font_size * (0.1f * si + ct->yof); | f[1] = font_size * (0.1f * si - (0.25f * co) + ct->yof); | ||||
| f[2] = font_size * (0.1f * co + ct->xof); | f[2] = font_size * (0.02f * co + ct->xof); | ||||
| f[3] = font_size * (-0.1f * si + ct->yof); | f[3] = font_size * (-0.1f * si - (0.25f * co) + ct->yof); | ||||
| f[4] = font_size * (0.1f * co + 0.8f * si + ct->xof); | f[4] = font_size * (0.02f * co + 0.8f * si + ct->xof); | ||||
| f[5] = font_size * (-0.1f * si + 0.8f * co + ct->yof); | f[5] = font_size * (-0.1f * si + 0.75f * co + ct->yof); | ||||
| f[6] = font_size * (-0.1f * co + 0.8f * si + ct->xof); | f[6] = font_size * (-0.02f * co + 0.8f * si + ct->xof); | ||||
| f[7] = font_size * (0.1f * si + 0.8f * co + ct->yof); | f[7] = font_size * (0.1f * si + 0.75f * co + ct->yof); | ||||
| } | } | ||||
| if (mode == FO_SELCHANGE) { | if (mode == FO_SELCHANGE) { | ||||
| MEM_freeN(chartransdata); | MEM_freeN(chartransdata); | ||||
| chartransdata = NULL; | chartransdata = NULL; | ||||
| } | } | ||||
| else if (mode == FO_EDIT) { | else if (mode == FO_EDIT) { | ||||
| /* Make NURBS-data. */ | /* Make NURBS-data. */ | ||||
| ▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines | |||||