Fix hook on undefined (#90)

This commit is contained in:
Chenlei Hu
2024-08-27 10:42:31 -04:00
committed by GitHub
parent 8e0494abd2
commit 9fe28f4826
2 changed files with 5 additions and 3 deletions

View File

@@ -1007,14 +1007,14 @@ export declare class LGraphNode {
): void;
onInputDblClick?(
slot: number,
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;
onOutputDblClick?(
slot: number,
event: MouseEvent,
pos: Vector2,
graphCanvas: LGraphCanvas
): void;

View File

@@ -6075,7 +6075,9 @@ LGraphNode.prototype.executeAction = function(action)
if (this.allow_interaction && is_double_click && this.selected_nodes[node.id]) {
//check if it's a double click on the title bar
if (pos[1] < LiteGraph.NODE_TITLE_HEIGHT) {
node?.onNodeTitleDblClick(e, pos, this);
if (node.onNodeTitleDblClick) {
node.onNodeTitleDblClick(e, pos, this);
}
}
//double click node
if (node.onDblClick) {