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

LibDraw: Add draw_ellipse_intersecting function

This functon will draw an ellipse which is intersecting the corners of
the rect given. It is a very naive implementation, taking 200 samples of
points around the ellipse, and drawing straight lines between each of
these points.

The ellipses look good enough to me though!
This commit is contained in:
Shannon Booth 2019-12-27 11:19:45 +13:00 committed by Andreas Kling
parent 0b3a868729
commit 123b5c9d34
2 changed files with 19 additions and 0 deletions

View file

@ -25,6 +25,7 @@ public:
void draw_rect(const Rect&, Color, bool rough = false);
void draw_bitmap(const Point&, const CharacterBitmap&, Color = Color());
void draw_bitmap(const Point&, const GlyphBitmap&, Color = Color());
void draw_ellipse_intersecting(const Rect&, Color, int thickness = 1);
void set_pixel(const Point&, Color);
void draw_line(const Point&, const Point&, Color, int thickness = 1, bool dotted = false);
void draw_scaled_bitmap(const Rect& dst_rect, const GraphicsBitmap&, const Rect& src_rect);