mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 03:13:30 +00:00
improve dom widget performance (#3584)
This commit is contained in:
parent
f6a203951f
commit
34030fed92
@ -11,9 +11,10 @@ function intersect(a, b) {
|
|||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getClipPath(node, element, elRect) {
|
function getClipPath(node, element) {
|
||||||
const selectedNode = Object.values(app.canvas.selected_nodes)[0];
|
const selectedNode = Object.values(app.canvas.selected_nodes)[0];
|
||||||
if (selectedNode && selectedNode !== node) {
|
if (selectedNode && selectedNode !== node) {
|
||||||
|
const elRect = element.getBoundingClientRect();
|
||||||
const MARGIN = 7;
|
const MARGIN = 7;
|
||||||
const scale = app.canvas.ds.scale;
|
const scale = app.canvas.ds.scale;
|
||||||
|
|
||||||
@ -269,7 +270,7 @@ LGraphNode.prototype.addDOMWidget = function (name, type, element, options) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (enableDomClipping) {
|
if (enableDomClipping) {
|
||||||
element.style.clipPath = getClipPath(node, element, elRect);
|
element.style.clipPath = getClipPath(node, element);
|
||||||
element.style.willChange = "clip-path";
|
element.style.willChange = "clip-path";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user