mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Refactor TypeSource
This commit is contained in:
@@ -211,6 +211,14 @@ pub enum DocumentNodeMetadata {
|
||||
DocumentNodePath,
|
||||
}
|
||||
|
||||
impl DocumentNodeMetadata {
|
||||
pub fn ty(&self) -> Type {
|
||||
match self {
|
||||
DocumentNodeMetadata::DocumentNodePath => concrete!(Vec<NodeId>),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl NodeInput {
|
||||
pub const fn node(node_id: NodeId, output_index: usize) -> Self {
|
||||
Self::Node { node_id, output_index }
|
||||
|
||||
@@ -39,11 +39,6 @@ pub struct NodeTypes {
|
||||
pub output: Type,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ResolvedDocumentNodeTypes {
|
||||
pub types: HashMap<Vec<NodeId>, NodeTypes>,
|
||||
}
|
||||
|
||||
type Path = Box<[NodeId]>;
|
||||
|
||||
#[derive(PartialEq, Clone, Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
@@ -61,6 +61,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEdito
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
// Keep this in sync with the protonode id in valid_input_types for the document network export
|
||||
DocumentNode {
|
||||
call_argument: concrete!(graphene_std::application_io::RenderConfig),
|
||||
inputs: vec![NodeInput::node(NodeId(3), 0)],
|
||||
|
||||
Reference in New Issue
Block a user