diff --git a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp index ecb3405e1d..0c9a431430 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp @@ -25,12 +25,14 @@ WebIDL::ExceptionOr> CanvasGradient::create_rad return realm.heap().allocate(realm, realm, *radial_gradient); } +// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createlineargradient JS::NonnullGCPtr CanvasGradient::create_linear(JS::Realm& realm, double x0, double y0, double x1, double y1) { auto linear_gradient = Gfx::CanvasLinearGradientPaintStyle::create(Gfx::FloatPoint { x0, y0 }, Gfx::FloatPoint { x1, y1 }); return realm.heap().allocate(realm, realm, *linear_gradient); } +// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createconicgradient JS::NonnullGCPtr CanvasGradient::create_conic(JS::Realm& realm, double start_angle, double x, double y) { auto conic_gradient = Gfx::CanvasConicGradientPaintStyle::create(Gfx::FloatPoint { x, y }, start_angle);