Skip to content

Commit 16c294e

Browse files
authored
Fix issue with subgraph inputs and outputs not being clickable in custom canvas size
1 parent 888173a commit 16c294e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/litegraph.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5806,7 +5806,7 @@ LGraphNode.prototype.executeAction = function(action)
58065806
this.mouse[1] = e.clientY;
58075807
this.graph_mouse[0] = e.canvasX;
58085808
this.graph_mouse[1] = e.canvasY;
5809-
this.last_click_position = [this.mouse[0],this.mouse[1]];
5809+
this.last_click_position = [this.graph_mouse[0],this.graph_mouse[1]];
58105810

58115811
if (this.pointer_is_down && is_primary ){
58125812
this.pointer_is_double = true;
@@ -8100,11 +8100,10 @@ LGraphNode.prototype.executeAction = function(action)
81008100
bgcolor = bgcolor || LiteGraph.NODE_DEFAULT_COLOR;
81018101
hovercolor = hovercolor || "#555";
81028102
textcolor = textcolor || LiteGraph.NODE_TEXT_COLOR;
8103-
var yFix = y + LiteGraph.NODE_TITLE_HEIGHT + 2; // fix the height with the title
8104-
var pos = this.mouse;
8105-
var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h );
8103+
var pos = this.graph_mouse;
8104+
var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h );
81068105
pos = this.last_click_position;
8107-
var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h );
8106+
var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h );
81088107

81098108
ctx.fillStyle = hover ? hovercolor : bgcolor;
81108109
if(clicked)

0 commit comments

Comments
 (0)