mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-05 12:56:42 +02:00
Check offscreen element in isElementVisible()
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user