mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
committed by
Jelle Raaijmakers
parent
c0e861e2fa
commit
7eb4f3da37
Notes:
github-actions[bot]
2025-01-23 08:34:31 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/7eb4f3da37c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3276 Reviewed-by: https://github.com/kalenikaliaksandr ✅
@@ -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>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user