From 74129b648b16f1c42be1d89ee9410ef344da8250 Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Fri, 18 Oct 2024 15:32:53 +0200 Subject: [PATCH] Fix #129142: GPv3: gesture select tools selecting only right handles When selection type is set/and for gesture selection tools, Instead of current attribute, all three selection attributes (`.selection`, `left_handle`, `right_handle`) are reset in every iteration of for loop. Pull Request: https://projects.blender.org/blender/blender/pulls/129147 --- .../grease_pencil/intern/grease_pencil_select.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc index 1ace7123609..426dec09d90 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc @@ -265,13 +265,9 @@ bool selection_update(const ViewContext *vc, /* Modes that un-set all elements not in the mask. */ if (ELEM(sel_op, SEL_OP_SET, SEL_OP_AND)) { - ed::curves::foreach_selection_attribute_writer( - curves, selection_domain, [&](bke::GSpanAttributeWriter &writer) { - for (const int element_i : IndexRange(writer.span.size())) { - ed::curves::apply_selection_operation_at_index( - writer.span, element_i, SEL_OP_SUB); - } - }); + bke::GSpanAttributeWriter selection = + curves.attributes_for_write().lookup_for_write_span(attribute_name); + ed::curves::fill_selection_false(selection.span); } if (use_segment_selection) {