mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-06 03:28:13 +08:00
Fix infinite recursion introduced in #2795 that occurs in old document migrations
This commit is contained in:
@@ -6649,7 +6649,7 @@ struct InputTransientMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Persistent metadata for each node in the network, which must be included when creating, serializing, and deserializing saving a node.
|
/// Persistent metadata for each node in the network, which must be included when creating, serializing, and deserializing saving a node.
|
||||||
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
#[derive(Default, Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||||
pub struct DocumentNodePersistentMetadata {
|
pub struct DocumentNodePersistentMetadata {
|
||||||
/// The name of the node definition, as originally set by [`DocumentNodeDefinition`], used to display in the UI and to display the appropriate properties if no display name is set.
|
/// The name of the node definition, as originally set by [`DocumentNodeDefinition`], used to display in the UI and to display the appropriate properties if no display name is set.
|
||||||
// TODO: Used during serialization/deserialization to prevent storing implementation or inputs (and possible other fields) if they are the same as the definition.
|
// TODO: Used during serialization/deserialization to prevent storing implementation or inputs (and possible other fields) if they are the same as the definition.
|
||||||
@@ -6676,21 +6676,6 @@ pub struct DocumentNodePersistentMetadata {
|
|||||||
pub network_metadata: Option<NodeNetworkMetadata>,
|
pub network_metadata: Option<NodeNetworkMetadata>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for DocumentNodePersistentMetadata {
|
|
||||||
fn default() -> Self {
|
|
||||||
DocumentNodePersistentMetadata {
|
|
||||||
reference: None,
|
|
||||||
display_name: String::new(),
|
|
||||||
input_metadata: Vec::new(),
|
|
||||||
output_names: Vec::new(),
|
|
||||||
pinned: false,
|
|
||||||
locked: false,
|
|
||||||
node_type_metadata: NodeTypePersistentMetadata::default(),
|
|
||||||
network_metadata: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DocumentNodePersistentMetadata {
|
impl DocumentNodePersistentMetadata {
|
||||||
pub fn is_layer(&self) -> bool {
|
pub fn is_layer(&self) -> bool {
|
||||||
matches!(self.node_type_metadata, NodeTypePersistentMetadata::Layer(_))
|
matches!(self.node_type_metadata, NodeTypePersistentMetadata::Layer(_))
|
||||||
|
|||||||
+7
-1
@@ -23,7 +23,13 @@ impl From<DocumentNodePersistentMetadataInputNames> for DocumentNodePersistentMe
|
|||||||
fn from(old: DocumentNodePersistentMetadataInputNames) -> Self {
|
fn from(old: DocumentNodePersistentMetadataInputNames) -> Self {
|
||||||
DocumentNodePersistentMetadata {
|
DocumentNodePersistentMetadata {
|
||||||
input_metadata: Vec::new(),
|
input_metadata: Vec::new(),
|
||||||
..old.into()
|
reference: old.reference,
|
||||||
|
display_name: old.display_name,
|
||||||
|
output_names: old.output_names,
|
||||||
|
locked: old.locked,
|
||||||
|
pinned: old.pinned,
|
||||||
|
node_type_metadata: old.node_type_metadata,
|
||||||
|
network_metadata: old.network_metadata,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user