mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-19 02:43:30 +00:00
Fix scaled position
This commit is contained in:
parent
32fd39b424
commit
1a322ca67a
@ -111,9 +111,13 @@ app.registerExtension({
|
|||||||
// Focus the filter box when opening
|
// Focus the filter box when opening
|
||||||
filter.focus();
|
filter.focus();
|
||||||
|
|
||||||
// If the top is off screen then shift the element
|
const rect = this.root.getBoundingClientRect();
|
||||||
if (parseInt(this.root.style.top) < 0) {
|
|
||||||
this.root.style.top = 0;
|
// If the top is off screen then shift the element with scaling applied
|
||||||
|
if (rect.top < 0) {
|
||||||
|
const scale = 1 - this.root.getBoundingClientRect().height / this.root.clientHeight;
|
||||||
|
const shift = (this.root.clientHeight * scale) / 2;
|
||||||
|
this.root.style.top = -shift + "px";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user