From 6b799a739c457580d1a0785c778fc51d826e94d2 Mon Sep 17 00:00:00 2001 From: MacDue Date: Wed, 20 Mar 2024 21:38:52 +0000 Subject: [PATCH] LibWeb: Use `ensure_subpath()` in `CanvasPath::arc_to()` No behaviour change. --- Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp index 84a3fa02e16..77eaefa2c77 100644 --- a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp +++ b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp @@ -184,14 +184,14 @@ WebIDL::ExceptionOr CanvasPath::arc_to(double x1, double y1, double x2, do return {}; // 2. Ensure there is a subpath for (x1, y1). - auto transform = active_transform(); - if (m_path.is_empty()) - m_path.move_to(transform.map(Gfx::FloatPoint { x1, y1 })); + ensure_subpath(x1, y1); // 3. If radius is negative, then throw an "IndexSizeError" DOMException. if (radius < 0) return WebIDL::IndexSizeError::create(m_self->realm(), MUST(String::formatted("The radius provided ({}) is negative.", radius))); + auto transform = active_transform(); + // 4. Let the point (x0, y0) be the last point in the subpath, // transformed by the inverse of the current transformation matrix // (so that it is in the same coordinate system as the points passed to the method).