Fix #132807: Grease Pencil: Joining strokes removes selection

Ensure selection attribute for last stroke after join operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/132840
This commit is contained in:
Pratik Borhade
2025-01-10 08:05:45 +01:00
committed by Pratik Borhade
parent 75f3fab268
commit 905d6c435a

View File

@@ -15,6 +15,7 @@
#include "DEG_depsgraph.hh"
#include "ED_curves.hh"
#include "ED_grease_pencil.hh"
#include "RNA_access.hh"
@@ -485,6 +486,17 @@ int grease_pencil_join_selection_exec(bContext *C, wmOperator *op)
append_strokes_from(std::move(tmp_curves), dst_curves);
bke::GSpanAttributeWriter selection = ed::curves::ensure_selection_attribute(
dst_curves, selection_domain, CD_PROP_BOOL);
if (selection_domain == bke::AttrDomain::Curve) {
ed::curves::fill_selection_true(selection.span.take_back(tmp_curves.curves_num()));
}
else {
ed::curves::fill_selection_true(selection.span.take_back(tmp_curves.points_num()));
}
selection.finish();
dst_curves.update_curve_types();
dst_curves.tag_topology_changed();
dst_drawing->tag_topology_changed();