mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibWeb: Add .shrink() to BorderRadiusData and BorderRadiiData
This commit is contained in:
parent
44057c9482
commit
0070c28714
1 changed files with 14 additions and 0 deletions
|
@ -28,6 +28,12 @@ struct BorderRadiusData {
|
|||
{
|
||||
return static_cast<int>(horizontal_radius) > 0 && static_cast<int>(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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue