Skip to content

Commit ce60075

Browse files
committed
Set up the control path layer above not below, and starting collapsed
1 parent 74181d1 commit ce60075

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,6 +2204,20 @@ impl DocumentMessageHandler {
22042204
responses.add(DocumentMessage::DocumentStructureChanged);
22052205
responses.add(NodeGraphMessage::SendGraph);
22062206

2207+
// The control path layer (Blend Path / Morph Path) should start collapsed.
2208+
let instance_path = {
2209+
// Build instance path from root down to the control path layer, which is a sibling of the main layer under `parent`.
2210+
let mut instance_path: Vec<NodeId> = parent
2211+
.ancestors(network_interface.document_metadata())
2212+
.take_while(|&ancestor| ancestor != LayerNodeIdentifier::ROOT_PARENT)
2213+
.map(LayerNodeIdentifier::to_node)
2214+
.collect();
2215+
instance_path.reverse();
2216+
instance_path.push(control_path_id);
2217+
instance_path
2218+
};
2219+
responses.add(DocumentMessage::ToggleLayerExpansion { instance_path, recursive: false });
2220+
22072221
return folder_id;
22082222
}
22092223
}

editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ impl MessageHandler<GraphOperationMessage, GraphOperationMessageContext<'_>> for
193193
let control_path_layer = modify_inputs.create_layer(control_path_id);
194194
let path_node_id = modify_inputs.insert_control_path_data(control_path_layer);
195195

196-
network_interface.move_layer_to_stack(layer, parent, insert_index, &[]);
197-
network_interface.move_layer_to_stack(control_path_layer, parent, insert_index + 1, &[]);
196+
network_interface.move_layer_to_stack(control_path_layer, parent, insert_index, &[]);
197+
network_interface.move_layer_to_stack(layer, parent, insert_index + 1, &[]);
198198

199199
// Connect the Path node's output to the chain node's path parameter input (input 4 for both Morph and Blend).
200200
// Done after move_layer_to_stack so chain nodes have correct positions when converted to absolute.

0 commit comments

Comments
 (0)