mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
Simplify properties sections
This commit is contained in:
parent
a182a7347e
commit
2013fdf70b
1 changed files with 5 additions and 12 deletions
|
@ -2129,19 +2129,12 @@ impl NodeGraphMessageHandler {
|
||||||
let node_properties = context
|
let node_properties = context
|
||||||
.network_interface
|
.network_interface
|
||||||
.upstream_flow_back_from_nodes(vec![layer], context.selection_network_path, network_interface::FlowType::HorizontalFlow)
|
.upstream_flow_back_from_nodes(vec![layer], context.selection_network_path, network_interface::FlowType::HorizontalFlow)
|
||||||
.enumerate()
|
.skip(1) // Skip the actual merge node
|
||||||
.take_while(|(i, node_id)| {
|
.take_while(|node_id| !context.network_interface.is_layer(node_id, context.selection_network_path)) // Go until another layer is reached
|
||||||
if *i == 0 {
|
.collect::<Vec<_>>() // Required to avoid borrowing context twice (for some reason generating a property requires &mut access?)
|
||||||
true
|
|
||||||
} else {
|
|
||||||
!context.network_interface.is_layer(node_id, context.selection_network_path)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.map(|(_, node_id)| node_id)
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|node_id| node_properties::generate_node_properties(node_id, context))
|
.rev() // Go from first node in the chain
|
||||||
.collect::<Vec<_>>();
|
.map(|node_id| node_properties::generate_node_properties(node_id, context));
|
||||||
|
|
||||||
layer_properties.extend(node_properties);
|
layer_properties.extend(node_properties);
|
||||||
layer_properties
|
layer_properties
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue