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:
Jelle Raaijmakers
2025-01-15 13:51:39 +01:00
committed by Jelle Raaijmakers
parent c0e861e2fa
commit 7eb4f3da37
7 changed files with 51 additions and 38 deletions

View File

@@ -209,7 +209,7 @@ CSSPixelRect PaintableBox::compute_absolute_paint_rect() const
continue;
auto inflate = shadow.spread_distance + shadow.blur_radius;
auto shadow_rect = rect.inflated(inflate, inflate, inflate, inflate).translated(shadow.offset_x, shadow.offset_y);
rect = rect.united(shadow_rect);
rect.unite(shadow_rect);
}
return rect;
}