瀏覽代碼

LibWeb: Use `ensure_subpath()` in `CanvasPath::arc_to()`

No behaviour change.
MacDue 1 年之前
父節點
當前提交
6b799a739c
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp

+ 3 - 3
Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.cpp

@@ -184,14 +184,14 @@ WebIDL::ExceptionOr<void> CanvasPath::arc_to(double x1, double y1, double x2, do
         return {};
         return {};
 
 
     // 2. Ensure there is a subpath for (x1, y1).
     // 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.
     // 3. If radius is negative, then throw an "IndexSizeError" DOMException.
     if (radius < 0)
     if (radius < 0)
         return WebIDL::IndexSizeError::create(m_self->realm(), MUST(String::formatted("The radius provided ({}) is negative.", radius)));
         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,
     // 4. Let the point (x0, y0) be the last point in the subpath,
     //    transformed by the inverse of the current transformation matrix
     //    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).
     //    (so that it is in the same coordinate system as the points passed to the method).