From c58ec3a66d936ed66a56d7b540f3296d1bff9985 Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Sun, 12 Feb 2023 01:59:54 -0800 Subject: [PATCH] Add lock canvas checkbox --- webshit/index.html | 5 +++++ webshit/litegraph.core.js | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/webshit/index.html b/webshit/index.html index 071c4b912..0e9d32fd6 100644 --- a/webshit/index.html +++ b/webshit/index.html @@ -556,6 +556,10 @@ function clearQueue() { .catch(error => console.error(error)); } +function lockCanvas(cb) { + canvas.allow_dragnodes = !cb.checked; +} + @@ -594,6 +598,7 @@ function clearQueue() {


+Lock Canvas diff --git a/webshit/litegraph.core.js b/webshit/litegraph.core.js index 9e5a031da..13bdfd685 100644 --- a/webshit/litegraph.core.js +++ b/webshit/litegraph.core.js @@ -6744,7 +6744,6 @@ LGraphNode.prototype.executeAction = function(action) this.node_dragged.pos[0] = Math.round(this.node_dragged.pos[0]); this.node_dragged.pos[1] = Math.round(this.node_dragged.pos[1]); if (this.graph.config.align_to_grid || this.align_to_grid ) { - console.warn("AAA") this.node_dragged.alignToGrid(); } if( this.onNodeMoved ) @@ -9955,7 +9954,6 @@ LGraphNode.prototype.executeAction = function(action) var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0; if (w.type == "number") { - console.log(w); if (w.options.step) { w.value += w.options.step * Math.sign(delta); }