Fix Boundary and collapsed issue

* If you collapse a node with a widget after loading the graph, it cannot be expanded.
* Compute Collapsed Nodes boundary is incorrect
This commit is contained in:
kdb621
2021-05-20 13:26:58 +09:00
parent 813bf57599
commit 75bf136797

View File

@@ -3499,7 +3499,7 @@
out[0] = this.pos[0] - 4;
out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT;
out[2] = this.size[0] + 4;
out[3] = this.size[1] + LiteGraph.NODE_TITLE_HEIGHT;
out[3] = this.flags.collapsed ? LiteGraph.NODE_TITLE_HEIGHT : this.size[1] + LiteGraph.NODE_TITLE_HEIGHT;
if (this.onBounding) {
this.onBounding(out);
@@ -8842,7 +8842,7 @@ LGraphNode.prototype.executeAction = function(action)
var widget_width = w.width || width;
//outside
if ( w != active_widget &&
(x < 6 || x > widget_width - 12 || y < w.last_y || y > w.last_y + widget_height) )
(x < 6 || x > widget_width - 12 || y < w.last_y || y > w.last_y + widget_height || w.last_y === undefined) )
continue;
var old_value = w.value;