mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibGfx: Add Rect::unite()
The existing `::unite_horizontally()` and `::unite_vertically()` tests did not properly test the edge cases where left/top in the Rect were updated, so they get re-arranged a bit.
This commit is contained in:
parent
c0e861e2fa
commit
7eb4f3da37
Notes:
github-actions[bot]
2025-01-23 08:34:31 +00:00
Author: https://github.com/gmta
Commit: 7eb4f3da37
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3276
Reviewed-by: https://github.com/kalenikaliaksandr ✅
7 changed files with 51 additions and 38 deletions
|
@ -927,7 +927,7 @@ GC::Ref<Geometry::DOMRect> Element::get_bounding_client_rect() const
|
|||
auto const& rect = list->item(i);
|
||||
if (rect->width() == 0 || rect->height() == 0)
|
||||
continue;
|
||||
bounding_rect = bounding_rect.united({ rect->x(), rect->y(), rect->width(), rect->height() });
|
||||
bounding_rect.unite({ rect->x(), rect->y(), rect->width(), rect->height() });
|
||||
}
|
||||
return Geometry::DOMRect::create(realm(), bounding_rect.to_type<float>());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue