Merge branch 'comfyanonymous:master' into refactor/execution

This commit is contained in:
Dr.Lt.Data 2023-06-04 00:48:32 +09:00 committed by GitHub
commit 5325e90352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7294,10 +7294,6 @@ LGraphNode.prototype.executeAction = function(action)
if (this.onShowNodePanel) { if (this.onShowNodePanel) {
this.onShowNodePanel(n); this.onShowNodePanel(n);
} }
else
{
this.showShowNodePanel(n);
}
if (this.onNodeDblClicked) { if (this.onNodeDblClicked) {
this.onNodeDblClicked(n); this.onNodeDblClicked(n);
@ -8099,11 +8095,15 @@ LGraphNode.prototype.executeAction = function(action)
bgcolor = bgcolor || LiteGraph.NODE_DEFAULT_COLOR; bgcolor = bgcolor || LiteGraph.NODE_DEFAULT_COLOR;
hovercolor = hovercolor || "#555"; hovercolor = hovercolor || "#555";
textcolor = textcolor || LiteGraph.NODE_TEXT_COLOR; textcolor = textcolor || LiteGraph.NODE_TEXT_COLOR;
var yFix = y + LiteGraph.NODE_TITLE_HEIGHT + 2; // fix the height with the title var pos = this.ds.convertOffsetToCanvas(this.graph_mouse);
var pos = this.mouse; var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h );
var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h ); pos = this.last_click_position ? [this.last_click_position[0], this.last_click_position[1]] : null;
pos = this.last_click_position; if(pos) {
var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,yFix,w,h ); var rect = this.canvas.getBoundingClientRect();
pos[0] -= rect.left;
pos[1] -= rect.top;
}
var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h );
ctx.fillStyle = hover ? hovercolor : bgcolor; ctx.fillStyle = hover ? hovercolor : bgcolor;
if(clicked) if(clicked)
@ -13067,6 +13067,10 @@ LGraphNode.prototype.executeAction = function(action)
has_submenu: true, has_submenu: true,
callback: LGraphCanvas.onShowMenuNodeProperties callback: LGraphCanvas.onShowMenuNodeProperties
}, },
{
content: "Properties Panel",
callback: function(item, options, e, menu, node) { LGraphCanvas.active_canvas.showShowNodePanel(node) }
},
null, null,
{ {
content: "Title", content: "Title",