Allow groups to work with the node graph (#1452)

* Initial groups

* Improve graph arangement

* Fix selecting nested layers

* Code review pass

* Change log

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-11-14 17:17:14 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent f4ec76f35e
commit 58660f5548
19 changed files with 397 additions and 306 deletions
@@ -17,7 +17,7 @@ use std::collections::VecDeque;
pub fn new_vector_layer(subpaths: Vec<Subpath<ManipulatorGroupId>>, layer_path: Vec<LayerId>, responses: &mut VecDeque<Message>) {
let id = *layer_path.last().unwrap();
responses.add(GraphOperationMessage::NewVectorLayer { id, subpaths });
responses.add(NodeGraphMessage::SetSelectedNodes { nodes: vec![id] })
responses.add(NodeGraphMessage::SelectedNodesSet { nodes: vec![id] })
}
/// Create a new bitmap layer from an [`graphene_core::raster::ImageFrame<Color>`]
@@ -232,7 +232,7 @@ impl<'a> NodeGraphLayer<'a> {
/// Return an iterator up the primary flow of the layer
pub fn primary_layer_flow(&self) -> impl Iterator<Item = (&'a DocumentNode, u64)> {
self.node_graph.primary_flow_from_opt(Some(self.layer_node))
self.node_graph.primary_flow_from_node(Some(self.layer_node))
}
/// Does a node exist in the layer's primary flow