Trim DOM widget vertical wrapper padding
tests / test (push) Canceled after 0s
tests / windows-storage (push) Canceled after 0s

This commit is contained in:
2026-10-15 09:45:42 +00:00
parent 33eec90f44
commit 2babd3635d
+4 -1
View File
@@ -261,7 +261,10 @@ function configure(node) {
// the old slot-count estimate left a large blank tail in the node.
// Measure the actual DOM panel instead of guessing from slot count.
const panelHeight = Math.ceil(panel.getBoundingClientRect().height || panel.scrollHeight || 0);
display.computeSize = (width) => [Math.max(420, Number(width) || 420), panelHeight + 2];
// LiteGraph adds roughly 7px above and below a DOM widget wrapper;
// those pixels are not part of the panel and otherwise appear as a
// vertical tail beneath/around the editor.
display.computeSize = (width) => [Math.max(420, Number(width) || 420), Math.max(0, panelHeight - 14)];
};
const refresh = () => { state = readState(stateWidget, Number(countWidget.value) || 2, Number(secondsWidget.value) || 4); render(); setState(); };
countWidget.callback = ((previous) => function(...args) { const result = previous?.apply(this, args); refresh(); return result; })(countWidget.callback);