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

LibDraw: Support dotted lines in Painter::draw_line()

Painter::draw_line() now has an optional "bool dotted" parameter that
causes it to only render every other pixel.

Note that this only works with horizontal and vertical lines at the
moment and we'll assert if called with dotted=true for a diagonal line.
This commit is contained in:
Andreas Kling 2019-11-27 20:52:11 +01:00
parent 5327de2df3
commit 478cfae7c8
2 changed files with 19 additions and 7 deletions

View file

@ -26,7 +26,7 @@ public:
void draw_bitmap(const Point&, const CharacterBitmap&, Color = Color());
void draw_bitmap(const Point&, const GlyphBitmap&, Color = Color());
void set_pixel(const Point&, Color);
void draw_line(const Point&, const Point&, Color, int thickness = 1);
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);
void blit(const Point&, const GraphicsBitmap&, const Rect& src_rect, float opacity = 1.0f);
void blit_dimmed(const Point&, const GraphicsBitmap&, const Rect& src_rect);