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

LibWeb: Add canvas.fill

This implements only one of the two forms of this function,
ctx.fill(winding_rule).
Also tweaks the quadratic curve demo to have a nice looking filled
shape.
This commit is contained in:
AnotherTest 2020-05-06 11:56:47 +04:30 committed by Andreas Kling
parent f54b41f748
commit a82419469f
5 changed files with 52 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#include <LibGfx/AffineTransform.h>
#include <LibGfx/Color.h>
#include <LibGfx/Forward.h>
#include <LibGfx/Painter.h>
#include <LibGfx/Path.h>
#include <LibWeb/Bindings/Wrappable.h>
@ -71,6 +72,7 @@ public:
void line_to(float x, float y);
void quadratic_curve_to(float cx, float cy, float x, float y);
void stroke();
void fill(Gfx::Painter::WindingRule);
RefPtr<ImageData> create_image_data(JS::GlobalObject&, int width, int height) const;
void put_image_data(const ImageData&, float x, float y);