mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-21 22:37:15 +08:00
Fix for hidden widgets showing
This commit is contained in:
parent
f10ea50cd5
commit
9e228faccd
@ -170,7 +170,10 @@ function computeSize(size) {
|
|||||||
// Override the compute visible nodes function to allow us to hide/show DOM elements when the node goes offscreen
|
// Override the compute visible nodes function to allow us to hide/show DOM elements when the node goes offscreen
|
||||||
const elementWidgets = new Set();
|
const elementWidgets = new Set();
|
||||||
const computeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
|
const computeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
|
||||||
LGraphCanvas.prototype.computeVisibleNodes = function () {
|
|
||||||
|
// @TODO: strip this double-assign once code is migrated
|
||||||
|
LiteGraph.LGraphCanvas.prototype.computeVisibleNodes =
|
||||||
|
window.LGraphCanvas.prototype.computeVisibleNodes = function () {
|
||||||
const visibleNodes = computeVisibleNodes.apply(this, arguments);
|
const visibleNodes = computeVisibleNodes.apply(this, arguments);
|
||||||
for (const node of app.graph._nodes) {
|
for (const node of app.graph._nodes) {
|
||||||
if (elementWidgets.has(node)) {
|
if (elementWidgets.has(node)) {
|
||||||
@ -204,7 +207,9 @@ export function addDomClippingSetting() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
|
// @TODO: strip this double-assign once code is migrated
|
||||||
|
LiteGraph.LGraphNode.prototype.addDOMWidget =
|
||||||
|
window.LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
|
||||||
options = { hideOnZoom: true, selectOn: ["focus", "click"], ...options };
|
options = { hideOnZoom: true, selectOn: ["focus", "click"], ...options };
|
||||||
|
|
||||||
if (!element.parentElement) {
|
if (!element.parentElement) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user