3 ms·
>It is very hard to check if a certain image is visible or not Canvases are rectangles. The viewport is a rectangle. Checking if rectangles overlap is easy.
by charcircuit 4y ago
>It is very hard to check if a certain image is visible or not
Canvases are rectangles. The viewport is a rectangle. Checking if rectangles overlap is easy.
- lifthrasiir 4y agoThe image is visible != the canvas and viewport overlaps, and this is not even a good enough approximation (the image can be obscured by other layers for example). Intersection Observer v2 takes us a bit closer but the visibility in this definition (not obscured at all) doesn't fully agree with what we want (has some pixels visible, some false positives allowed).