mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add Layer and Artboard node definitions and underlying data structures (#1204)
* Add basic node defenitions * Code review * change widget code * Artboard node changes --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
parent
7e1b452757
commit
4e0c673a35
@@ -286,7 +286,7 @@ impl NodeGraphExecutor {
|
||||
self.last_output_type.insert(layer_path.clone(), Some(concrete!(VectorData)));
|
||||
responses.add(Operation::SetLayerTransform { path: layer_path.clone(), transform });
|
||||
responses.add(Operation::SetVectorData { path: layer_path, vector_data });
|
||||
} else {
|
||||
} else if core::any::TypeId::of::<ImageFrame<Color>>() == DynAny::type_id(boxed_node_graph_output.as_ref()) {
|
||||
// Attempt to downcast to an image frame
|
||||
let ImageFrame { image, transform } = dyn_any::downcast(boxed_node_graph_output).map(|image_frame| *image_frame)?;
|
||||
self.last_output_type.insert(layer_path.clone(), Some(concrete!(ImageFrame<Color>)));
|
||||
@@ -316,6 +316,14 @@ impl NodeGraphExecutor {
|
||||
}];
|
||||
responses.add(FrontendMessage::UpdateImageData { document_id, image_data });
|
||||
}
|
||||
} else if core::any::TypeId::of::<graphene_core::Artboard>() == DynAny::type_id(boxed_node_graph_output.as_ref()) {
|
||||
let artboard: graphene_core::Artboard = dyn_any::downcast(boxed_node_graph_output).map(|artboard| *artboard)?;
|
||||
info!("{artboard:#?}");
|
||||
return Err(format!("Artboard (see console)"));
|
||||
} else if core::any::TypeId::of::<graphene_core::GraphicGroup>() == DynAny::type_id(boxed_node_graph_output.as_ref()) {
|
||||
let graphic_group: graphene_core::GraphicGroup = dyn_any::downcast(boxed_node_graph_output).map(|graphic| *graphic)?;
|
||||
info!("{graphic_group:#?}");
|
||||
return Err(format!("Graphic group (see console)"));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user