Fix #134395: "Intersect" selection mode not working for Grease Pencil

Intersect mode needs to set everything **outside** of the selection mask
to non-selected and leave the rest untouched.
We already had the comment to "un-set all elements not in the mask" but
that was actually unsetting **everything**.

In theory, we could also early out for `SEL_OP_AND` since the following
`apply_mask_as_` calls are not doing anything for `SEL_OP_AND` really
(but left the change to be minimal).

Pull Request: https://projects.blender.org/blender/blender/pulls/134400
This commit is contained in:
Philipp Oeser
2025-02-11 18:54:02 +01:00
committed by Falk David
parent 1cb2d991f9
commit c042c67011

View File

@@ -269,7 +269,10 @@ bool selection_update(const ViewContext *vc,
bke::SpanAttributeWriter<bool> selection =
curves.attributes_for_write().lookup_or_add_for_write_span<bool>(attribute_name,
selection_domain);
ed::curves::fill_selection_false(selection.span);
IndexMaskMemory memory;
const IndexMask not_in_mask = changed_element_mask.complement(
selection.span.index_range(), memory);
ed::curves::fill_selection_false(selection.span, not_in_mask);
selection.finish();
}