Improve the node graph with revamped top bar and disabling tools when graph is open (#2093)

* Add "Fade Artwork" slider and disable tools when graph is open

* Add navigation and layer/node management buttons to graph top bar

* Reduce code duplication
This commit is contained in:
Keavon Chambers
2024-11-04 20:41:53 +00:00
committed by GitHub
parent 12ca06035c
commit f1b0d8fa87
19 changed files with 480 additions and 285 deletions
+5 -6
View File
@@ -577,8 +577,7 @@ impl EditorHandle {
let message = NodeGraphMessage::CreateNodeFromContextMenu {
node_id: Some(id),
node_type,
x: x / 24,
y: y / 24,
xy: Some((x / 24, y / 24)),
};
self.dispatch(message);
}
@@ -652,10 +651,10 @@ impl EditorHandle {
self.dispatch(message);
}
/// Unpin a node given its node ID
#[wasm_bindgen(js_name = unpinNode)]
pub fn unpin_node(&self, id: u64) {
self.dispatch(DocumentMessage::SetNodePinned { node_id: NodeId(id), pinned: false });
/// Pin or unpin a node given its node ID
#[wasm_bindgen(js_name = setNodePinned)]
pub fn set_node_pinned(&self, id: u64, pinned: bool) {
self.dispatch(DocumentMessage::SetNodePinned { node_id: NodeId(id), pinned });
}
/// Delete a layer or node given its node ID