Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/gpencil_geom.cc
| Show First 20 Lines • Show All 3,210 Lines • ▼ Show 20 Lines | for (idx = 0; idx < num_islands; idx++) { | ||||
| bGPDspoint *pts; | bGPDspoint *pts; | ||||
| float delta = gps->points[island->start_idx].time; | float delta = gps->points[island->start_idx].time; | ||||
| int j; | int j; | ||||
| new_stroke->inittime += double(delta); | new_stroke->inittime += double(delta); | ||||
| pts = new_stroke->points; | pts = new_stroke->points; | ||||
| for (j = 0; j < new_stroke->totpoints; j++, pts++) { | for (j = 0; j < new_stroke->totpoints; j++, pts++) { | ||||
| pts->time -= delta; | /* Some points have time = 0, so check to not get negative time values.*/ | ||||
| pts->time = max_ff(pts->time - delta, 0.0f); | |||||
antoniov: instead of the if, you could use `pt->time = max_ff(pt->time - delta, 0.0f);` if the… | |||||
| /* set flag for select again later */ | /* set flag for select again later */ | ||||
| if (select == true) { | if (select == true) { | ||||
| pts->flag &= ~GP_SPOINT_SELECT; | pts->flag &= ~GP_SPOINT_SELECT; | ||||
| pts->flag |= GP_SPOINT_TAG; | pts->flag |= GP_SPOINT_TAG; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,122 Lines • Show Last 20 Lines | |||||
instead of the if, you could use pt->time = max_ff(pt->time - delta, 0.0f); if the variables are int then use max_ii