From 4b16cb1e9aff4410cda1e2182e73330c814f99ac Mon Sep 17 00:00:00 2001 From: Falk David Date: Sat, 27 Feb 2021 09:28:37 +0100 Subject: Fix T85987: Selection when GP is parented When a GP object was parented to e.g. a bone, box selection as well as point selection were broken in that the selection from the user would not correlate with what was actually being selected. The issue was that box and point selection did not use the active evaluated stroke data. The fix uses the correct data. Reviewed By: antoniov Maniphest Tasks: T85987 Differential Revision: https://developer.blender.org/D10555 --- source/blender/editors/gpencil/gpencil_select.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index e01c1ec54d7..aab08e9c8c4 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -1847,7 +1847,7 @@ static bool gpencil_generic_stroke_select(bContext *C, bGPDspoint *pt; int i; bool hit = false; - for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { + for (i = 0, pt = gps_active->points; i < gps_active->totpoints; i++, pt++) { bGPDspoint *pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt; /* convert point coords to screenspace */ @@ -2252,12 +2252,12 @@ static int gpencil_select_exec(bContext *C, wmOperator *op) int i; /* firstly, check for hit-point */ - for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { + for (i = 0, pt = gps_active->points; i < gps_active->totpoints; i++, pt++) { int xy[2]; bGPDspoint pt2; gpencil_point_to_parent_space(pt, gpstroke_iter.diff_mat, &pt2); - gpencil_point_to_xy(&gsc, gps, &pt2, &xy[0], &xy[1]); + gpencil_point_to_xy(&gsc, gps_active, &pt2, &xy[0], &xy[1]); /* do boundbox check first */ if (!ELEM(V2D_IS_CLIPPED, xy[0], xy[1])) { -- cgit v1.2.3