Skip to content

Commit

Permalink
improve dom widget performance (#3584)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed May 27, 2024
1 parent f6a2039 commit 34030fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/scripts/domWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ function intersect(a, b) {
else return null;
}

function getClipPath(node, element, elRect) {
function getClipPath(node, element) {
const selectedNode = Object.values(app.canvas.selected_nodes)[0];
if (selectedNode && selectedNode !== node) {
const elRect = element.getBoundingClientRect();
const MARGIN = 7;
const scale = app.canvas.ds.scale;

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

if (enableDomClipping) {
element.style.clipPath = getClipPath(node, element, elRect);
element.style.clipPath = getClipPath(node, element);
element.style.willChange = "clip-path";
}

Expand Down

0 comments on commit 34030fe

Please sign in to comment.