mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +00:00
LibWeb+LibGfx: Make IntersectionObserver checks edge-inclusive
This fixes an issue where 0x0 rectangles were not considered to be intersecting, even when they fell inside (or were adjacent to) the viewport.
This commit is contained in:
parent
4e653c99bb
commit
31a69ce887
Notes:
github-actions[bot]
2025-02-16 17:10:02 +00:00
Author: https://github.com/awesomekling
Commit: 31a69ce887
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3593
3 changed files with 11 additions and 6 deletions
|
@ -395,6 +395,12 @@ public:
|
|||
&& other.top() < bottom();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool edge_adjacent_intersects(Rect<T> const& other) const
|
||||
{
|
||||
return max(left(), other.left()) <= min(right(), other.right())
|
||||
&& max(top(), other.top()) <= min(bottom(), other.bottom());
|
||||
}
|
||||
|
||||
template<typename Container>
|
||||
[[nodiscard]] bool intersects(Container const& others) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue