Path2D
Generated from idl/canvas.webidl when the site was built at 7aa23e2.
Path2D is an interface in idl/canvas.webidl, exposed in Window, Worker. It includes CanvasPath. What it does is on MDN; this page says what niso has of it.
Status
Section titled “Status”The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).
| Feature | On the web | In niso | Members |
|---|---|---|---|
| 2D canvas | Widely available | Partial 77% 1209 of 1553 subtests pass | 13 |
Members
Section titled “Members”constructor
Section titled “constructor”[NisoGlue] constructor(optional any path);create()
Section titled “create()”[NisoInternal] static Path2D create(Path2D? copy, DOMString? svg);int32_t niso_path2_d_create(niso_dom* dom, niso_handle copy, const char* svg, size_t svg_len, niso_handle* out);A copy of copy, the path svg describes, or an empty path.
addPath()
Section titled “addPath()”[NisoGlue] undefined addPath(Path2D path, optional any transform = null);addPathWith()
Section titled “addPathWith()”[NisoInternal] undefined addPathWith(Path2D path, unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);int32_t niso_path2_d_add_path_with(niso_dom* dom, niso_handle self, niso_handle path, double a, double b, double c, double d, double e, double f);closePath()
Section titled “closePath()”undefined closePath();int32_t niso_canvas_path_close_path(niso_dom* dom, niso_handle self);moveTo()
Section titled “moveTo()”undefined moveTo(unrestricted double x, unrestricted double y);int32_t niso_canvas_path_move_to(niso_dom* dom, niso_handle self, double x, double y);lineTo()
Section titled “lineTo()”undefined lineTo(unrestricted double x, unrestricted double y);int32_t niso_canvas_path_line_to(niso_dom* dom, niso_handle self, double x, double y);quadraticCurveTo()
Section titled “quadraticCurveTo()”undefined quadraticCurveTo(unrestricted double cpx, unrestricted double cpy, unrestricted double x, unrestricted double y);int32_t niso_canvas_path_quadratic_curve_to(niso_dom* dom, niso_handle self, double cpx, double cpy, double x, double y);bezierCurveTo()
Section titled “bezierCurveTo()”undefined bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y);int32_t niso_canvas_path_bezier_curve_to(niso_dom* dom, niso_handle self, double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);arcTo()
Section titled “arcTo()”undefined arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius);int32_t niso_canvas_path_arc_to(niso_dom* dom, niso_handle self, double x1, double y1, double x2, double y2, double radius);rect()
Section titled “rect()”undefined rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);int32_t niso_canvas_path_rect(niso_dom* dom, niso_handle self, double x, double y, double w, double h);roundRect()
Section titled “roundRect()”[NisoGlue] undefined roundRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, optional any radii = 0);roundRectWith()
Section titled “roundRectWith()”[NisoInternal] undefined roundRectWith(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, Float64Array radii);int32_t niso_canvas_path_round_rect_with(niso_dom* dom, niso_handle self, double x, double y, double w, double h, const uint8_t* radii, size_t radii_len);radii: an x and y radius for each corner, upper left first.
operation from CanvasPathundefined arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean counterclockwise = false);int32_t niso_canvas_path_arc(niso_dom* dom, niso_handle self, double x, double y, double radius, double start_angle, double end_angle, bool counterclockwise);ellipse()
Section titled “ellipse()”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);int32_t niso_canvas_path_ellipse(niso_dom* dom, niso_handle self, double x, double y, double radius_x, double radius_y, double rotation, double start_angle, double end_angle, bool counterclockwise);