Skip to main content
Module

x/canvas/mod.ts>SkPathConstructorAndFactory

Canvas API for Deno, ported from canvaskit-wasm (Skia).
Go to Latest
interface SkPathConstructorAndFactory
import { type SkPathConstructorAndFactory } from "https://deno.land/x/canvas@v1.0.0/mod.ts";

Contains the ways to create an SkPath.

Methods

MakeFromCmds(cmds: PathCommand[]): SkPath

Creates a new path from the given list of path commands.

MakeFromVerbsPointsWeights(
verbs: VerbList,
weights?: WeightList,
): SkPath

Creates a new path using the provided verbs and associated points and weights. The process reads the first verb from verbs and then the appropriate number of points from the FlattenedPointArray (e.g. 2 points for moveTo, 4 points for quadTo, etc). If the verb is a conic, a weight will be read from the WeightList. If the data is malformed (e.g. not enough points), the resulting path will be incomplete.