diff options
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index c364f89dc9f..0329598d711 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -399,20 +399,13 @@ static void gp_triangulate_stroke_fill(bGPDstroke *gps) gps->triangles = MEM_recallocN(gps->triangles, sizeof(*gps->triangles) * gps->tot_triangles); } - int triangle_index = 0; int i; - for (i = 0; (i < gps->totpoints) && (triangle_index < gps->tot_triangles); i++) { - if ((tmp_triangles[i][0] >= 0) && (tmp_triangles[i][0] < gps->totpoints) && - (tmp_triangles[i][1] >= 0) && (tmp_triangles[i][1] < gps->totpoints) && - (tmp_triangles[i][2] >= 0) && (tmp_triangles[i][2] < gps->totpoints)) - { - bGPDtriangle *stroke_triangle = &gps->triangles[triangle_index++]; - - stroke_triangle->v1 = tmp_triangles[i][0]; - stroke_triangle->v2 = tmp_triangles[i][1]; - stroke_triangle->v3 = tmp_triangles[i][2]; - } + for (i = 0; i < gps->tot_triangles; i++) { + bGPDtriangle *stroke_triangle = &gps->triangles[i]; + stroke_triangle->v1 = tmp_triangles[i][0]; + stroke_triangle->v2 = tmp_triangles[i][1]; + stroke_triangle->v3 = tmp_triangles[i][2]; } } else { |