mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +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
|
@ -89,9 +89,8 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box)
|
|||
|
||||
// - All line boxes directly contained by the scroll container.
|
||||
if (is<Painting::PaintableWithLines>(box.first_paintable())) {
|
||||
for (auto const& fragment : static_cast<Painting::PaintableWithLines const&>(*box.first_paintable()).fragments()) {
|
||||
scrollable_overflow_rect = scrollable_overflow_rect.united(fragment.absolute_rect());
|
||||
}
|
||||
for (auto const& fragment : static_cast<Painting::PaintableWithLines const&>(*box.first_paintable()).fragments())
|
||||
scrollable_overflow_rect.unite(fragment.absolute_rect());
|
||||
}
|
||||
|
||||
auto content_overflow_rect = scrollable_overflow_rect;
|
||||
|
@ -117,8 +116,8 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box)
|
|||
if (child_border_box.bottom() < 0 || child_border_box.right() < 0)
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
scrollable_overflow_rect = scrollable_overflow_rect.united(child_border_box);
|
||||
content_overflow_rect = content_overflow_rect.united(child_border_box);
|
||||
scrollable_overflow_rect.unite(child_border_box);
|
||||
content_overflow_rect.unite(child_border_box);
|
||||
|
||||
// - The scrollable overflow areas of all of the above boxes
|
||||
// (including zero-area boxes and accounting for transforms as described above),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue