1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

LibGfx: Add Painter::fill_rect_with_rounded_corners()

This paints a rectangle with rounded corners each specified by a
radius.
This commit is contained in:
Tobias Christiansen 2021-05-15 23:33:21 +02:00 committed by Andreas Kling
parent 520441d472
commit 819e0e0440
2 changed files with 146 additions and 1 deletions

View file

@ -36,6 +36,7 @@ public:
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(const IntRect&, Color gradient_start, Color gradient_end);
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 draw_rect(const IntRect&, Color, bool rough = false);
void draw_focus_rect(const IntRect&, Color);
@ -71,6 +72,14 @@ public:
void draw_emoji(const IntPoint&, const Gfx::Bitmap&, const Font&);
void draw_glyph_or_emoji(const IntPoint&, u32 code_point, const Font&, Color);
enum class CornerOrientation {
TopLeft,
TopRight,
BottomRight,
BottomLeft
};
void fill_rounded_corner(const IntRect&, int radius, Color, CornerOrientation);
static void for_each_line_segment_on_bezier_curve(const FloatPoint& control_point, const FloatPoint& p1, const FloatPoint& p2, Function<void(const FloatPoint&, const FloatPoint&)>&);
static void for_each_line_segment_on_bezier_curve(const FloatPoint& control_point, const FloatPoint& p1, const FloatPoint& p2, Function<void(const FloatPoint&, const FloatPoint&)>&&);