Skip to content

Commit 34030fe

Browse files
authored
improve dom widget performance (comfyanonymous#3584)
1 parent f6a2039 commit 34030fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/scripts/domWidget.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ function intersect(a, b) {
1111
else return null;
1212
}
1313

14-
function getClipPath(node, element, elRect) {
14+
function getClipPath(node, element) {
1515
const selectedNode = Object.values(app.canvas.selected_nodes)[0];
1616
if (selectedNode && selectedNode !== node) {
17+
const elRect = element.getBoundingClientRect();
1718
const MARGIN = 7;
1819
const scale = app.canvas.ds.scale;
1920

@@ -269,7 +270,7 @@ LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
269270
});
270271

271272
if (enableDomClipping) {
272-
element.style.clipPath = getClipPath(node, element, elRect);
273+
element.style.clipPath = getClipPath(node, element);
273274
element.style.willChange = "clip-path";
274275
}
275276

0 commit comments

Comments
 (0)