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

LibGfx: Add Gfx::Path, a basic 2D path with <canvas> semantics

This will be used to implement painting of 2D paths. This first patch
adds support for line_to(), move_to() and close().

It will try to have the same semantics as the HTML <canvas> element.

To stroke a Path, simply pass it to Painter::stroke_path().
This commit is contained in:
Andreas Kling 2020-04-16 21:03:17 +02:00
parent 72df9c7417
commit 60c2e41079
6 changed files with 176 additions and 0 deletions

View file

@ -69,6 +69,8 @@ public:
void draw_emoji(const Point&, const Gfx::Bitmap&, const Font&);
void draw_glyph_or_emoji(const Point&, u32 codepoint, const Font&, Color);
void stroke_path(const Path&, Color, int thickness);
const Font& font() const { return *state().font; }
void set_font(const Font& font) { state().font = &font; }