Path2D

open class Path2D(path: Path2D = definedExternally) : CanvasPath(source)

The Path2D interface of the Canvas 2D API is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired.

MDN Reference

Constructors

Link copied to clipboard
constructor(path: Path2D = definedExternally)
constructor(path: String)

Functions

Link copied to clipboard
external fun addPath(path: Path2D, transform: DOMMatrixReadOnly = definedExternally)

The Path2D.addPath() method of the Canvas 2D API adds one Path2D object to another Path2D object.

Link copied to clipboard
open external fun arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean = definedExternally)
Link copied to clipboard
open external fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double)
Link copied to clipboard
open external fun bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double)
Link copied to clipboard
open external fun closePath()
Link copied to clipboard
open external fun ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean = definedExternally)
Link copied to clipboard
open external fun lineTo(x: Double, y: Double)
Link copied to clipboard
open external fun moveTo(x: Double, y: Double)
Link copied to clipboard
open external fun quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double)
Link copied to clipboard
open external fun rect(x: Double, y: Double, w: Double, h: Double)
Link copied to clipboard
open external fun roundRect(x: Double, y: Double, w: Double, h: Double, radii: JsAny = definedExternally)