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:
parent
72df9c7417
commit
60c2e41079
6 changed files with 176 additions and 0 deletions
|
@ -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; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue