mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibGfx: Add helper for painting a rounded rect with equal corner radii
This commit is contained in:
parent
bee1e06055
commit
4903186cc5
2 changed files with 6 additions and 0 deletions
|
@ -247,6 +247,11 @@ void Painter::fill_rect_with_gradient(const IntRect& a_rect, Color gradient_star
|
||||||
return fill_rect_with_gradient(Orientation::Horizontal, a_rect, gradient_start, gradient_end);
|
return fill_rect_with_gradient(Orientation::Horizontal, a_rect, gradient_start, gradient_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Painter::fill_rect_with_rounded_corners(const IntRect& a_rect, Color color, int radius)
|
||||||
|
{
|
||||||
|
return fill_rect_with_rounded_corners(a_rect, color, radius, radius, radius, radius);
|
||||||
|
}
|
||||||
|
|
||||||
void Painter::fill_rect_with_rounded_corners(const IntRect& a_rect, Color color, int top_left_radius, int top_right_radius, int bottom_right_radius, int bottom_left_radius)
|
void Painter::fill_rect_with_rounded_corners(const IntRect& a_rect, Color color, int top_left_radius, int top_right_radius, int bottom_right_radius, int bottom_left_radius)
|
||||||
{
|
{
|
||||||
// Fasttrack for rects without any border radii
|
// Fasttrack for rects without any border radii
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
void fill_rect_with_checkerboard(const IntRect&, const IntSize&, Color color_dark, Color color_light);
|
void fill_rect_with_checkerboard(const IntRect&, const IntSize&, Color color_dark, Color color_light);
|
||||||
void fill_rect_with_gradient(Orientation, const IntRect&, Color gradient_start, Color gradient_end);
|
void fill_rect_with_gradient(Orientation, const IntRect&, Color gradient_start, Color gradient_end);
|
||||||
void fill_rect_with_gradient(const IntRect&, Color gradient_start, Color gradient_end);
|
void fill_rect_with_gradient(const IntRect&, Color gradient_start, Color gradient_end);
|
||||||
|
void fill_rect_with_rounded_corners(const IntRect&, Color, int radius);
|
||||||
void fill_rect_with_rounded_corners(const IntRect&, Color, int top_left_radius, int top_right_radius, int bottom_right_radius, int bottom_left_radius);
|
void fill_rect_with_rounded_corners(const IntRect&, Color, int top_left_radius, int top_right_radius, int bottom_right_radius, int bottom_left_radius);
|
||||||
void fill_ellipse(const IntRect&, Color);
|
void fill_ellipse(const IntRect&, Color);
|
||||||
void draw_rect(const IntRect&, Color, bool rough = false);
|
void draw_rect(const IntRect&, Color, bool rough = false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue