Skip to content

Commit 51df6ed

Browse files
authored
Merge branch 'comfyanonymous:master' into Main
2 parents 312de85 + 0f2a905 commit 51df6ed

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/litegraph.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8100,11 +8100,15 @@ 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 );
8106-
pos = this.last_click_position;
8107-
var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h );
8103+
var pos = this.ds.convertOffsetToCanvas(this.graph_mouse);
8104+
var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h );
8105+
pos = this.last_click_position ? [this.last_click_position[0], this.last_click_position[1]] : null;
8106+
if(pos) {
8107+
var rect = this.canvas.getBoundingClientRect();
8108+
pos[0] -= rect.left;
8109+
pos[1] -= rect.top;
8110+
}
8111+
var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h );
81088112

81098113
ctx.fillStyle = hover ? hovercolor : bgcolor;
81108114
if(clicked)

0 commit comments

Comments
 (0)