diff options
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil_geom.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_geom.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c index 14eb6bb4f4c..672d65f1585 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.c +++ b/source/blender/blenkernel/intern/gpencil_geom.c @@ -245,24 +245,23 @@ static int stroke_march_next_point(const bGPDstroke *gps, return 0; } - else { - float ratio = remaining_march / remaining_till_next; - interp_v3_v3v3(result, step_start, point, ratio); - *pressure = interpf( - gps->points[next_point_index].pressure, gps->points[next_point_index - 1].pressure, ratio); - *strength = interpf( - gps->points[next_point_index].strength, gps->points[next_point_index - 1].strength, ratio); - interp_v4_v4v4(vert_color, - gps->points[next_point_index - 1].vert_color, - gps->points[next_point_index].vert_color, - ratio); - - *index_from = next_point_index - 1; - *index_to = next_point_index; - *ratio_result = ratio; - return next_point_index; - } + float ratio = remaining_march / remaining_till_next; + interp_v3_v3v3(result, step_start, point, ratio); + *pressure = interpf( + gps->points[next_point_index].pressure, gps->points[next_point_index - 1].pressure, ratio); + *strength = interpf( + gps->points[next_point_index].strength, gps->points[next_point_index - 1].strength, ratio); + interp_v4_v4v4(vert_color, + gps->points[next_point_index - 1].vert_color, + gps->points[next_point_index].vert_color, + ratio); + + *index_from = next_point_index - 1; + *index_to = next_point_index; + *ratio_result = ratio; + + return next_point_index; } static int stroke_march_next_point_no_interp(const bGPDstroke *gps, @@ -306,11 +305,10 @@ static int stroke_march_next_point_no_interp(const bGPDstroke *gps, copy_v3_v3(result, &pt->x); return 0; } - else { - float ratio = remaining_march / remaining_till_next; - interp_v3_v3v3(result, step_start, point, ratio); - return next_point_index; - } + + float ratio = remaining_march / remaining_till_next; + interp_v3_v3v3(result, step_start, point, ratio); + return next_point_index; } static int stroke_march_count(const bGPDstroke *gps, const float dist) @@ -1352,10 +1350,9 @@ bool BKE_gpencil_stroke_trim(bGPDstroke *gps) if ((lambda <= 0.0f) || (lambda >= 1.0f)) { continue; } - else { - intersect = true; - break; - } + + intersect = true; + break; } } } |