mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibWeb: Add canvas.quadraticCurveTo()
Also adds a test, and removes debug spam ™️
This commit is contained in:
parent
9f3f98d4c0
commit
0a55679de4
7 changed files with 70 additions and 2 deletions
|
@ -165,10 +165,13 @@ void CanvasRenderingContext2D::line_to(float x, float y)
|
|||
m_path.line_to({ x, y });
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::quadratic_curve_to(float cx, float cy, float x, float y)
|
||||
{
|
||||
m_path.quadratic_bezier_curve_to({ cx, cy }, { x, y });
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::stroke()
|
||||
{
|
||||
dbg() << "stroke path " << m_path;
|
||||
|
||||
auto painter = this->painter();
|
||||
if (!painter)
|
||||
return;
|
||||
|
|
|
@ -69,6 +69,7 @@ public:
|
|||
void close_path();
|
||||
void move_to(float x, float y);
|
||||
void line_to(float x, float y);
|
||||
void quadratic_curve_to(float cx, float cy, float x, float y);
|
||||
void stroke();
|
||||
|
||||
RefPtr<ImageData> create_image_data(JS::GlobalObject&, int width, int height) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue