mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
LibWeb: Change paint_all_borders() to accept only device pixel values
By consistently accepting only device pixel values instead of a mix of CSSPixels and DevicePixels values, we can simplify the implementation of paint_border() and paint_all_borders().
This commit is contained in:
parent
ae8c98104a
commit
70353b79af
9 changed files with 152 additions and 88 deletions
|
@ -33,6 +33,15 @@ struct BorderRadiusData {
|
|||
}
|
||||
};
|
||||
|
||||
using CornerRadius = Gfx::AntiAliasingPainter::CornerRadius;
|
||||
|
||||
struct CornerRadii {
|
||||
CornerRadius top_left;
|
||||
CornerRadius top_right;
|
||||
CornerRadius bottom_right;
|
||||
CornerRadius bottom_left;
|
||||
};
|
||||
|
||||
struct BorderRadiiData {
|
||||
BorderRadiusData top_left;
|
||||
BorderRadiusData top_right;
|
||||
|
@ -56,15 +65,16 @@ struct BorderRadiiData {
|
|||
{
|
||||
shrink(-top, -right, -bottom, -left);
|
||||
}
|
||||
};
|
||||
|
||||
using CornerRadius = Gfx::AntiAliasingPainter::CornerRadius;
|
||||
|
||||
struct CornerRadii {
|
||||
CornerRadius top_left;
|
||||
CornerRadius top_right;
|
||||
CornerRadius bottom_right;
|
||||
CornerRadius bottom_left;
|
||||
inline CornerRadii as_corners(PaintContext& context) const
|
||||
{
|
||||
return CornerRadii {
|
||||
top_left.as_corner(context),
|
||||
top_right.as_corner(context),
|
||||
bottom_right.as_corner(context),
|
||||
bottom_left.as_corner(context)
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue