Pen tool: do not merge with ancestor layer as it breaks the graph (#3347)

This commit is contained in:
James Lindsay 2025-11-08 08:29:08 +00:00 committed by GitHub
parent 68e67055d8
commit 3490111b96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ pub fn find_spline(document: &DocumentMessageHandler, layer: LayerNodeIdentifier
/// Merge `second_layer` to the `first_layer`. /// Merge `second_layer` to the `first_layer`.
pub fn merge_layers(document: &DocumentMessageHandler, first_layer: LayerNodeIdentifier, second_layer: LayerNodeIdentifier, responses: &mut VecDeque<Message>) { pub fn merge_layers(document: &DocumentMessageHandler, first_layer: LayerNodeIdentifier, second_layer: LayerNodeIdentifier, responses: &mut VecDeque<Message>) {
if first_layer == second_layer { // Skip layers that are children of each other (or the same)
if first_layer.ancestors(document.metadata()).any(|l| l == second_layer) || second_layer.ancestors(document.metadata()).any(|l| l == first_layer) {
return; return;
} }
// Calculate the downstream transforms in order to bring the other vector geometry into the same layer space // Calculate the downstream transforms in order to bring the other vector geometry into the same layer space