mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 20:28:12 +08:00
Create node by dragging link into empty space (#1438)
* Create node by dragging into empty space * Prevent add menu when disconnecting a link --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
b8906f344e
commit
6ff958d6ae
@@ -643,9 +643,11 @@ impl JsEditorHandle {
|
||||
|
||||
/// 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) {
|
||||
let message = NodeGraphMessage::CreateNode { node_id: None, node_type, x, y };
|
||||
pub fn create_node(&self, node_type: String, x: i32, y: i32) -> u64 {
|
||||
let id = generate_uuid();
|
||||
let message = NodeGraphMessage::CreateNode { node_id: Some(id), node_type, x, y };
|
||||
self.dispatch(message);
|
||||
id
|
||||
}
|
||||
|
||||
/// Notifies the backend that the user selected a node in the node graph
|
||||
|
||||
Reference in New Issue
Block a user