mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 09:08:13 +08:00
Replace node definition string-based lookups with DefinitionIdentifier instances (#3451)
* create definition identifier and integrate it * Bug fixes and code review * formatting * Fix migrations * Fix remove handles migration * formatting * Fix test * Fix tests 2 * fix deserialization * Code review * Small fixes * Consolidate 'Morph' node migrations * Add old SamplePointsNode name to migrations list * Fix tests * Unrelated small fix * Fix migration crashes * Fix tests * Final code review * fmt * Add metadata --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
4fea2b0fe7
commit
a6052c5819
@@ -721,11 +721,13 @@ impl EditorHandle {
|
||||
|
||||
/// Creates a new document node in the node graph
|
||||
#[wasm_bindgen(js_name = createNode)]
|
||||
pub fn create_node(&self, node_type: String, x: i32, y: i32) {
|
||||
pub fn create_node(&self, node_type: JsValue, x: i32, y: i32) {
|
||||
let value: serde_json::Value = serde_wasm_bindgen::from_value(node_type).unwrap();
|
||||
|
||||
let id = NodeId::new();
|
||||
let message = NodeGraphMessage::CreateNodeFromContextMenu {
|
||||
node_id: Some(id),
|
||||
node_type,
|
||||
node_type: value.into(),
|
||||
xy: Some((x / 24, y / 24)),
|
||||
add_transaction: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user