mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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:
parent
f54b41f748
commit
a82419469f
5 changed files with 52 additions and 0 deletions
|
@ -179,6 +179,15 @@ void CanvasRenderingContext2D::stroke()
|
|||
painter->stroke_path(m_path, m_stroke_style, m_line_width);
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::fill(Gfx::Painter::WindingRule winding)
|
||||
{
|
||||
auto painter = this->painter();
|
||||
if (!painter)
|
||||
return;
|
||||
|
||||
painter->fill_path(m_path, m_fill_style, winding);
|
||||
}
|
||||
|
||||
RefPtr<ImageData> CanvasRenderingContext2D::create_image_data(JS::GlobalObject& global_object, int width, int height) const
|
||||
{
|
||||
return ImageData::create_with_size(global_object, width, height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue