Fixed an issue where the main menu disappears intermittently as the coordinates become negative. (#3269)

main
Dr.Lt.Data 10 months ago committed by GitHub
parent abc69cab45
commit 072e3bd2b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -90,12 +90,15 @@ function dragElement(dragEl, settings) {
}).observe(dragEl);
function ensureInBounds() {
if (dragEl.classList.contains("comfy-menu-manual-pos")) {
try {
newPosX = Math.min(document.body.clientWidth - dragEl.clientWidth, Math.max(0, dragEl.offsetLeft));
newPosY = Math.min(document.body.clientHeight - dragEl.clientHeight, Math.max(0, dragEl.offsetTop));
positionElement();
}
catch(exception){
// robust
}
}
function positionElement() {

Loading…
Cancel
Save