From 5e38384034650f75e382366a312099c2544386ae Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 4 Jan 2021 10:48:52 +0100 Subject: Fix T84362: Crash when use Vertex Paint in subdivide strokes Maniphest Tasks: T84362 Differential Revision: https://developer.blender.org/D9983 --- source/blender/editors/gpencil/gpencil_vertex_paint.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c index 3afff897734..62ddfaab012 100644 --- a/source/blender/editors/gpencil/gpencil_vertex_paint.c +++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c @@ -908,14 +908,14 @@ static bool gpencil_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso, /* To each point individually... */ pt = &gps->points[i]; - pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt; - index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i; + pt_active = pt->runtime.pt_orig; if (pt_active != NULL) { /* If masked and the point is not selected, skip it. */ if ((GPENCIL_ANY_VERTEX_MASK(gso->mask)) && ((pt_active->flag & GP_SPOINT_SELECT) == 0)) { continue; } + index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i; hit = true; gpencil_save_selected_point(gso, gps_active, index, pc1); saved = true; @@ -931,9 +931,9 @@ static bool gpencil_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso, */ if (i + 1 == gps->totpoints - 1) { pt = &gps->points[i + 1]; - pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt; - index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i + 1; + pt_active = pt->runtime.pt_orig; if (pt_active != NULL) { + index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i + 1; hit = true; gpencil_save_selected_point(gso, gps_active, index, pc2); include_last = false; @@ -951,9 +951,9 @@ static bool gpencil_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso, * (but wasn't added then, to avoid double-ups). */ pt = &gps->points[i]; - pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt; - index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i; + pt_active = pt->runtime.pt_orig; if (pt_active != NULL) { + index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i; hit = true; gpencil_save_selected_point(gso, gps_active, index, pc1); include_last = false; -- cgit v1.2.3