diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index af18e0e..f6b1344 100644 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -237,7 +237,7 @@ function escapeHtml(html) { } function isElementVisible($elm) { const rect = $elm.getBoundingClientRect(); - return !!rect.width && !!rect.height; + return (rect.x >= 0 || rect.y >= 0) && !!rect.width && !!rect.height; } function removeChildElements($parent) { while ($parent.firstElementChild) diff --git a/src/utils/html.ts b/src/utils/html.ts index 3e921b3..8b02362 100644 --- a/src/utils/html.ts +++ b/src/utils/html.ts @@ -163,7 +163,7 @@ export function escapeHtml(html: string): string { export function isElementVisible($elm: HTMLElement): boolean { const rect = $elm.getBoundingClientRect(); - return !!rect.width && !!rect.height; + return (rect.x >= 0 || rect.y >= 0) && !!rect.width && !!rect.height; } export const CTN = document.createTextNode.bind(document);