mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
LibWeb: Extract CanvasPath class from CRC2D
This better matches the spec, and makes it possible for things like Path2D to reuse the same implementation without duplicate code. :^)
This commit is contained in:
parent
8fd83b56d5
commit
a37ab7b9f8
7 changed files with 184 additions and 132 deletions
13
Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.idl
Normal file
13
Userland/Libraries/LibWeb/HTML/Canvas/CanvasPath.idl
Normal file
|
@ -0,0 +1,13 @@
|
|||
// https://html.spec.whatwg.org/multipage/canvas.html#canvaspath
|
||||
interface mixin CanvasPath {
|
||||
undefined closePath();
|
||||
undefined moveTo(unrestricted double x, unrestricted double y);
|
||||
undefined lineTo(unrestricted double x, unrestricted double y);
|
||||
undefined quadraticCurveTo(unrestricted double cpx, unrestricted double cpy, unrestricted double x, unrestricted double y);
|
||||
undefined bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y);
|
||||
// FIXME: undefined arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius);
|
||||
undefined rect(unrestricted double x, unrestricted double y, unrestricted double width, unrestricted double height);
|
||||
// FIXME: undefined roundRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, optional (unrestricted double or DOMPointInit or sequence<(unrestricted double or DOMPointInit)>) radii = 0);
|
||||
undefined arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean counterclockwise = false);
|
||||
undefined ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean counterclockwise = false);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue