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

LibGfx: Add Painter::draw_circle_arc_intersecting()

This adds a function to draw a circle specified by a center point (
relative to the given Rect) and a radius. The circle arc is only drawn
inside the specified Rect as to allow for circle arc segments.
Technically this was already possible using draw_elliptical_arc(), but
the algorithm is quite involved and lead to wonky arcs when trying to
draw circle arc segments.
This commit is contained in:
Tobias Christiansen 2021-05-16 16:14:33 +02:00 committed by Andreas Kling
parent 819e0e0440
commit 8b63c2a10e
2 changed files with 44 additions and 0 deletions

View file

@ -71,6 +71,7 @@ public:
void draw_glyph(const IntPoint&, u32, const Font&, Color);
void draw_emoji(const IntPoint&, const Gfx::Bitmap&, const Font&);
void draw_glyph_or_emoji(const IntPoint&, u32 code_point, const Font&, Color);
void draw_circle_arc_intersecting(const IntRect&, const IntPoint&, int radius, Color, int thickness);
enum class CornerOrientation {
TopLeft,