diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-05-05 06:54:26 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-05 09:21:07 +0200 |
commit | 0a55679de465d770767de36da8fefb573644d86e (patch) | |
tree | c1ccec5b32f96b9373559306c9bbb35a36090e12 /Libraries/LibWeb/DOM | |
parent | 9f3f98d4c0c111496e35010ae3488dc172da56db (diff) | |
download | serenity-0a55679de465d770767de36da8fefb573644d86e.zip |
LibWeb: Add canvas.quadraticCurveTo()
Also adds a test, and removes debug spam :tm:
Diffstat (limited to 'Libraries/LibWeb/DOM')
-rw-r--r-- | Libraries/LibWeb/DOM/CanvasRenderingContext2D.cpp | 7 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/CanvasRenderingContext2D.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Libraries/LibWeb/DOM/CanvasRenderingContext2D.cpp b/Libraries/LibWeb/DOM/CanvasRenderingContext2D.cpp index 8359cbaf44..12a2791482 100644 --- a/Libraries/LibWeb/DOM/CanvasRenderingContext2D.cpp +++ b/Libraries/LibWeb/DOM/CanvasRenderingContext2D.cpp @@ -165,10 +165,13 @@ void CanvasRenderingContext2D::line_to(float x, float y) m_path.line_to({ x, y }); } -void CanvasRenderingContext2D::stroke() +void CanvasRenderingContext2D::quadratic_curve_to(float cx, float cy, float x, float y) { - dbg() << "stroke path " << m_path; + m_path.quadratic_bezier_curve_to({ cx, cy }, { x, y }); +} +void CanvasRenderingContext2D::stroke() +{ auto painter = this->painter(); if (!painter) return; diff --git a/Libraries/LibWeb/DOM/CanvasRenderingContext2D.h b/Libraries/LibWeb/DOM/CanvasRenderingContext2D.h index 2b46422d60..c3bb5a9d1f 100644 --- a/Libraries/LibWeb/DOM/CanvasRenderingContext2D.h +++ b/Libraries/LibWeb/DOM/CanvasRenderingContext2D.h @@ -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; |