mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 12:08:11 +08:00
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:
co-authored by
Keavon Chambers
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
|
// Next, we decide what to display based on the number of layers and nodes selected
|
||||||
match *layers.as_slice() {
|
match *layers.as_slice() {
|
||||||
// If no layers are selected, show properties for all selected nodes
|
// If no layers are selected, show properties for all selected nodes
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ pub struct LayerPanelEntry {
|
|||||||
pub clippable: bool,
|
pub clippable: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// IMPORTANT: the same node may appear multiple times.
|
||||||
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize, PartialEq, Eq, specta::Type)]
|
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize, PartialEq, Eq, specta::Type)]
|
||||||
pub struct SelectedNodes(pub Vec<NodeId>);
|
pub struct SelectedNodes(pub Vec<NodeId>);
|
||||||
|
|
||||||
@@ -129,6 +130,7 @@ impl SelectedNodes {
|
|||||||
self.selected_layers(metadata).any(|selected| selected == layer)
|
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> + '_ {
|
pub fn selected_nodes(&self) -> impl Iterator<Item = &NodeId> + '_ {
|
||||||
self.0.iter()
|
self.0.iter()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user