mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-10 14:20:49 +08:00
Add lock canvas checkbox
This commit is contained in:
parent
e9363ebe29
commit
c58ec3a66d
@ -556,6 +556,10 @@ function clearQueue() {
|
|||||||
.catch(error => console.error(error));
|
.catch(error => console.error(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lockCanvas(cb) {
|
||||||
|
canvas.allow_dragnodes = !cb.checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -594,6 +598,7 @@ function clearQueue() {
|
|||||||
<br>
|
<br>
|
||||||
<button style="font-size: 20px;" onclick="clearGraph()">Clear</button><br>
|
<button style="font-size: 20px;" onclick="clearGraph()">Clear</button><br>
|
||||||
<button style="font-size: 20px;" onclick="loadTxt2Img()">Load Default</button><br>
|
<button style="font-size: 20px;" onclick="loadTxt2Img()">Load Default</button><br>
|
||||||
|
<input type="checkbox" id="lockcanvas" name="lockcanvas" value="false" onclick="lockCanvas(this)">Lock Canvas</input>
|
||||||
</span>
|
</span>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -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[0] = Math.round(this.node_dragged.pos[0]);
|
||||||
this.node_dragged.pos[1] = Math.round(this.node_dragged.pos[1]);
|
this.node_dragged.pos[1] = Math.round(this.node_dragged.pos[1]);
|
||||||
if (this.graph.config.align_to_grid || this.align_to_grid ) {
|
if (this.graph.config.align_to_grid || this.align_to_grid ) {
|
||||||
console.warn("AAA")
|
|
||||||
this.node_dragged.alignToGrid();
|
this.node_dragged.alignToGrid();
|
||||||
}
|
}
|
||||||
if( this.onNodeMoved )
|
if( this.onNodeMoved )
|
||||||
@ -9955,7 +9954,6 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
|
|
||||||
var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0;
|
var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0;
|
||||||
if (w.type == "number") {
|
if (w.type == "number") {
|
||||||
console.log(w);
|
|
||||||
if (w.options.step) {
|
if (w.options.step) {
|
||||||
w.value += w.options.step * Math.sign(delta);
|
w.value += w.options.step * Math.sign(delta);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user