diff --git a/Userland/Libraries/LibWeb/Painting/BorderPainting.h b/Userland/Libraries/LibWeb/Painting/BorderPainting.h index 0505870f0e..921ab4107a 100644 --- a/Userland/Libraries/LibWeb/Painting/BorderPainting.h +++ b/Userland/Libraries/LibWeb/Painting/BorderPainting.h @@ -28,6 +28,12 @@ struct BorderRadiusData { { return static_cast(horizontal_radius) > 0 && static_cast(vertical_radius) > 0; } + + inline void shrink(float horizontal, float vertical) + { + horizontal_radius = max(0, horizontal_radius - horizontal); + vertical_radius = max(0, vertical_radius - vertical); + } }; struct BorderRadiiData { @@ -40,6 +46,14 @@ struct BorderRadiiData { { return top_left || top_right || bottom_right || bottom_left; } + + inline void shrink(float top, float right, float bottom, float left) + { + top_left.shrink(left, top); + top_right.shrink(right, top); + bottom_right.shrink(right, bottom); + bottom_left.shrink(left, bottom); + } }; BorderRadiiData normalized_border_radii_data(Layout::Node const&, Gfx::FloatRect const&, CSS::BorderRadiusData top_left_radius, CSS::BorderRadiusData top_right_radius, CSS::BorderRadiusData bottom_right_radius, CSS::BorderRadiusData bottom_left_radius);