summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-03 20:01:19 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-03 22:35:13 +0100
commit90a874482370d98ee76726683aed4c0e1b7a847a (patch)
tree96354447e0f747cf1266b85c5bab0b0ab6bdd7ab /Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
parent34f6c88ffdf0157e2734c74670e19459ba29e948 (diff)
downloadserenity-90a874482370d98ee76726683aed4c0e1b7a847a.zip
LibWeb: Add CanvasRenderingContext2D.bezierCurveTo()
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
index feadcac595..4a521bc1e4 100644
--- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
+++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -189,6 +189,11 @@ void CanvasRenderingContext2D::quadratic_curve_to(float cx, float cy, float x, f
m_path.quadratic_bezier_curve_to({ cx, cy }, { x, y });
}
+void CanvasRenderingContext2D::bezier_curve_to(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y)
+{
+ m_path.cubic_bezier_curve_to(Gfx::FloatPoint(cp1x, cp1y), Gfx::FloatPoint(cp2x, cp2y), Gfx::FloatPoint(x, y));
+}
+
DOM::ExceptionOr<void> CanvasRenderingContext2D::arc(float x, float y, float radius, float start_angle, float end_angle, bool counter_clockwise)
{
if (radius < 0)