Skip to content

Commit a1796db

Browse files
0HyperCubeKeavon
andauthored
Fix a single layer twice selected hiding the properties (#2911)
* Fix a single layer twice selected hiding the properties * Comment that the same node appears several times --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent 85021fd commit a1796db

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,12 @@ impl NodeGraphMessageHandler {
22652265
}
22662266
}
22672267

2268+
// The same layer/node may appear several times. Sort and dedup them for a stable ordering.
2269+
layers.sort();
2270+
layers.dedup();
2271+
nodes.sort();
2272+
nodes.dedup();
2273+
22682274
// Next, we decide what to display based on the number of layers and nodes selected
22692275
match *layers.as_slice() {
22702276
// If no layers are selected, show properties for all selected nodes

editor/src/messages/portfolio/document/utility_types/nodes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub struct LayerPanelEntry {
6161
pub clippable: bool,
6262
}
6363

64+
/// IMPORTANT: the same node may appear multiple times.
6465
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize, PartialEq, Eq, specta::Type)]
6566
pub struct SelectedNodes(pub Vec<NodeId>);
6667

@@ -129,6 +130,7 @@ impl SelectedNodes {
129130
self.selected_layers(metadata).any(|selected| selected == layer)
130131
}
131132

133+
/// IMPORTANT: the same node may appear multiple times.
132134
pub fn selected_nodes(&self) -> impl Iterator<Item = &NodeId> + '_ {
133135
self.0.iter()
134136
}

0 commit comments

Comments
 (0)