mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 11:28:30 +08:00
Migrate the Text tool to the document graph (#1435)
* Update text tool to document graph * Fix selection issue * Log graph reruns and text node evals * Hash to set node * Fix let node crash * Fix loading document with fonts * Allow pressing enter to edit * Cleanup * Code review nits --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
3d4e3a74e5
commit
b8906f344e
@@ -197,6 +197,7 @@ pub struct ProtoNode {
|
||||
pub identifier: NodeIdentifier,
|
||||
pub document_node_path: Vec<NodeId>,
|
||||
pub skip_deduplication: bool,
|
||||
pub hash: u64,
|
||||
}
|
||||
|
||||
/// A ProtoNodeInput represents the input of a node in a ProtoNetwork.
|
||||
@@ -235,6 +236,7 @@ impl ProtoNode {
|
||||
if self.skip_deduplication {
|
||||
self.document_node_path.hash(&mut hasher);
|
||||
}
|
||||
self.hash.hash(&mut hasher);
|
||||
std::mem::discriminant(&self.input).hash(&mut hasher);
|
||||
match self.input {
|
||||
ProtoNodeInput::None => (),
|
||||
@@ -256,6 +258,7 @@ impl ProtoNode {
|
||||
input: ProtoNodeInput::None,
|
||||
document_node_path: path,
|
||||
skip_deduplication: false,
|
||||
hash: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,6 +364,7 @@ impl ProtoNetwork {
|
||||
input,
|
||||
document_node_path: path,
|
||||
skip_deduplication: false,
|
||||
hash: 0,
|
||||
},
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user