Fix undefined var 'cloned' (#33)

This commit is contained in:
Chenlei Hu
2024-07-28 13:19:03 -04:00
committed by GitHub
parent a86d8797c5
commit ea8a9effe5

View File

@@ -5920,7 +5920,8 @@ LGraphNode.prototype.executeAction = function(action)
// clone node ALT dragging
if (LiteGraph.alt_drag_do_clone_nodes && e.altKey && node && this.allow_interaction && !skip_action && !this.read_only)
{
if (cloned = node.clone()){
const cloned = node.clone()
if (cloned) {
cloned.pos[0] += 5;
cloned.pos[1] += 5;
this.graph.add(cloned,false,{doCalcSize: false});