Skip to content

Commit 3490111

Browse files
authored
Pen tool: do not merge with ancestor layer as it breaks the graph (#3347)
1 parent 68e6705 commit 3490111

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/src/messages/tool/common_functionality/graph_modification_utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ pub fn find_spline(document: &DocumentMessageHandler, layer: LayerNodeIdentifier
3232

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

0 commit comments

Comments
 (0)