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

PixelPaint: Add rounded rectangles (both with/without antialiasing)

This commit is contained in:
MacDue 2022-06-01 22:17:55 +01:00 committed by Andreas Kling
parent a30c81104d
commit f1baa56cc8
2 changed files with 85 additions and 29 deletions

View file

@ -32,6 +32,7 @@ private:
Outline,
Fill,
Gradient,
RoundedCorners
};
enum class DrawMode {
@ -39,7 +40,7 @@ private:
FromCorner,
};
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness);
void draw_using(GUI::Painter&, Gfx::IntPoint const& start_position, Gfx::IntPoint const& end_position, int thickness, int corner_radius);
RefPtr<GUI::Widget> m_properties_widget;
RefPtr<GUI::TextBox> m_aspect_w_textbox;
@ -52,6 +53,8 @@ private:
DrawMode m_draw_mode { DrawMode::FromCorner };
int m_thickness { 1 };
Optional<float> m_aspect_ratio;
bool m_antialias_enabled { false };
int m_corner_radius = { 8 };
};
}