mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 03:08:12 +08:00
WIP prototype migrations
This commit is contained in:
@@ -11,6 +11,15 @@ pub struct Node {
|
||||
}
|
||||
|
||||
impl Node {
|
||||
pub fn new(implementation: Implementation, inputs: Vec<InputSlot>, attributes: Attributes, network: NetworkId) -> Self {
|
||||
Self {
|
||||
implementation,
|
||||
inputs,
|
||||
attributes,
|
||||
network,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn implementation(&self) -> &Implementation {
|
||||
&self.implementation
|
||||
}
|
||||
@@ -24,6 +33,21 @@ impl Node {
|
||||
self.network
|
||||
}
|
||||
|
||||
// Mutable access for edits on a registry clone that is diffed back into deltas;
|
||||
// live-session edits go through the delta paths instead.
|
||||
pub fn implementation_mut(&mut self) -> &mut Implementation {
|
||||
&mut self.implementation
|
||||
}
|
||||
pub fn inputs_mut(&mut self) -> &mut Vec<InputSlot> {
|
||||
&mut self.inputs
|
||||
}
|
||||
pub fn attributes_mut(&mut self) -> &mut Attributes {
|
||||
&mut self.attributes
|
||||
}
|
||||
pub fn set_network(&mut self, network: NetworkId) {
|
||||
self.network = network;
|
||||
}
|
||||
|
||||
/// True if both nodes agree on every value-bearing field, ignoring slot/attribute timestamps.
|
||||
pub fn value_equal(&self, other: &Self) -> bool {
|
||||
if self.implementation != other.implementation || self.network != other.network {
|
||||
|
||||
Reference in New Issue
Block a user