|
48 | 48 | EVENT_LINK_COLOR: "#A86",
|
49 | 49 | CONNECTING_LINK_COLOR: "#AFA",
|
50 | 50 |
|
51 |
| - MAX_NUMBER_OF_NODES: 1000, //avoid infinite loops |
| 51 | + MAX_NUMBER_OF_NODES: 10000, //avoid infinite loops |
52 | 52 | DEFAULT_POSITION: [100, 100], //default node position
|
53 | 53 | VALID_SHAPES: ["default", "box", "round", "card"], //,"circle"
|
54 | 54 |
|
|
3788 | 3788 |
|
3789 | 3789 | /**
|
3790 | 3790 | * returns the bounding of the object, used for rendering purposes
|
3791 |
| - * bounding is: [topleft_cornerx, topleft_cornery, width, height] |
3792 | 3791 | * @method getBounding
|
3793 |
| - * @return {Float32Array[4]} the total size |
| 3792 | + * @param out {Float32Array[4]?} [optional] a place to store the output, to free garbage |
| 3793 | + * @param compute_outer {boolean?} [optional] set to true to include the shadow and connection points in the bounding calculation |
| 3794 | + * @return {Float32Array[4]} the bounding box in format of [topleft_cornerx, topleft_cornery, width, height] |
3794 | 3795 | */
|
3795 |
| - LGraphNode.prototype.getBounding = function(out) { |
| 3796 | + LGraphNode.prototype.getBounding = function(out, compute_outer) { |
3796 | 3797 | out = out || new Float32Array(4);
|
3797 |
| - out[0] = this.pos[0] - 4; |
3798 |
| - out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT; |
3799 |
| - out[2] = this.flags.collapsed ? (this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH) : this.size[0] + 4; |
3800 |
| - out[3] = this.flags.collapsed ? LiteGraph.NODE_TITLE_HEIGHT : this.size[1] + LiteGraph.NODE_TITLE_HEIGHT; |
| 3798 | + const nodePos = this.pos; |
| 3799 | + const isCollapsed = this.flags.collapsed; |
| 3800 | + const nodeSize = this.size; |
| 3801 | + |
| 3802 | + let left_offset = 0; |
| 3803 | + // 1 offset due to how nodes are rendered |
| 3804 | + let right_offset = 1 ; |
| 3805 | + let top_offset = 0; |
| 3806 | + let bottom_offset = 0; |
| 3807 | + |
| 3808 | + if (compute_outer) { |
| 3809 | + // 4 offset for collapsed node connection points |
| 3810 | + left_offset = 4; |
| 3811 | + // 6 offset for right shadow and collapsed node connection points |
| 3812 | + right_offset = 6 + left_offset; |
| 3813 | + // 4 offset for collapsed nodes top connection points |
| 3814 | + top_offset = 4; |
| 3815 | + // 5 offset for bottom shadow and collapsed node connection points |
| 3816 | + bottom_offset = 5 + top_offset; |
| 3817 | + } |
| 3818 | + |
| 3819 | + out[0] = nodePos[0] - left_offset; |
| 3820 | + out[1] = nodePos[1] - LiteGraph.NODE_TITLE_HEIGHT - top_offset; |
| 3821 | + out[2] = isCollapsed ? |
| 3822 | + (this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH) + right_offset : |
| 3823 | + nodeSize[0] + right_offset; |
| 3824 | + out[3] = isCollapsed ? |
| 3825 | + LiteGraph.NODE_TITLE_HEIGHT + bottom_offset : |
| 3826 | + nodeSize[1] + LiteGraph.NODE_TITLE_HEIGHT + bottom_offset; |
3801 | 3827 |
|
3802 | 3828 | if (this.onBounding) {
|
3803 | 3829 | this.onBounding(out);
|
@@ -7674,7 +7700,7 @@ LGraphNode.prototype.executeAction = function(action)
|
7674 | 7700 | continue;
|
7675 | 7701 | }
|
7676 | 7702 |
|
7677 |
| - if (!overlapBounding(this.visible_area, n.getBounding(temp))) { |
| 7703 | + if (!overlapBounding(this.visible_area, n.getBounding(temp, true))) { |
7678 | 7704 | continue;
|
7679 | 7705 | } //out of the visible area
|
7680 | 7706 |
|
@@ -11336,6 +11362,7 @@ LGraphNode.prototype.executeAction = function(action)
|
11336 | 11362 | name_element.innerText = title;
|
11337 | 11363 | var value_element = dialog.querySelector(".value");
|
11338 | 11364 | value_element.value = value;
|
| 11365 | + value_element.select(); |
11339 | 11366 |
|
11340 | 11367 | var input = value_element;
|
11341 | 11368 | input.addEventListener("keydown", function(e) {
|
|
0 commit comments