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>
This commit is contained in:
parent
85021fd9e0
commit
a1796dbc08
|
|
@ -2265,6 +2265,12 @@ impl NodeGraphMessageHandler {
|
|||
}
|
||||
}
|
||||
|
||||
// The same layer/node may appear several times. Sort and dedup them for a stable ordering.
|
||||
layers.sort();
|
||||
layers.dedup();
|
||||
nodes.sort();
|
||||
nodes.dedup();
|
||||
|
||||
// Next, we decide what to display based on the number of layers and nodes selected
|
||||
match *layers.as_slice() {
|
||||
// If no layers are selected, show properties for all selected nodes
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ pub struct LayerPanelEntry {
|
|||
pub clippable: bool,
|
||||
}
|
||||
|
||||
/// IMPORTANT: the same node may appear multiple times.
|
||||
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize, PartialEq, Eq, specta::Type)]
|
||||
pub struct SelectedNodes(pub Vec<NodeId>);
|
||||
|
||||
|
|
@ -129,6 +130,7 @@ impl SelectedNodes {
|
|||
self.selected_layers(metadata).any(|selected| selected == layer)
|
||||
}
|
||||
|
||||
/// IMPORTANT: the same node may appear multiple times.
|
||||
pub fn selected_nodes(&self) -> impl Iterator<Item = &NodeId> + '_ {
|
||||
self.0.iter()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue