skia
    Preparing search index...

    Interface Path

    See SkPath.h for more information on this class. A Path is immutable. See PathBuilder for how to construct a path in a mutable fashion.

    interface Path {
        _type: "Path";
        computeTightBounds(outputArray?: Rect): Rect;
        contains(x: number, y: number): boolean;
        copy(): Path;
        countPoints(): number;
        delete(): void;
        deleteLater(): void;
        equals(other: Path): boolean;
        getBounds(outputArray?: Rect): Rect;
        getFillType(): EmbindEnumEntity;
        getPoint(index: number, outputArray?: Point): Point;
        isAliasOf(other: any): boolean;
        isDeleted(): boolean;
        isEmpty(): boolean;
        makeAsWinding(): Path | null;
        makeCombined(other: Path, op: EmbindEnumEntity): Path | null;
        makeDashed(on: number, off: number, phase: number): Path | null;
        makeSimplified(): Path | null;
        makeStroked(opts?: StrokeOpts): Path | null;
        makeTrimmed(
            startT: number,
            stopT: number,
            isComplement: boolean,
        ): Path | null;
        setFillType(fill: EmbindEnumEntity): void;
        toCmds(): Float32Array;
        toSVGString(): string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _type: "Path"

    Methods

    • Returns minimum and maximum axes values of the lines and curves in Path. Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may be larger or smaller than area affected when Path is drawn.

      Behaves identically to getBounds() when Path contains only lines. If Path contains curves, computed bounds includes the maximum extent of the quad, conic, or cubic; is slower than getBounds(); and unlike getBounds(), does not cache the result.

      Parameters

      • OptionaloutputArray: Rect

        if provided, the bounding box will be copied into this array instead of allocating a new one.

      Returns Rect

    • Returns true if the point (x, y) is contained by Path, taking into account FillType.

      Parameters

      • x: number
      • y: number

      Returns boolean

    • Returns the number of points in this path. Initially zero.

      Returns number

    • Returns true if other path is equal to this path.

      Parameters

      Returns boolean

    • Returns minimum and maximum axes values of Point array. Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may be larger or smaller than area affected when Path is drawn.

      Parameters

      • OptionaloutputArray: Rect

        if provided, the bounding box will be copied into this array instead of allocating a new one.

      Returns Rect

    • Returns the Point at index in Point array. Valid range for index is 0 to countPoints() - 1.

      Parameters

      • index: number
      • OptionaloutputArray: Point

        if provided, the point will be copied into this array instead of allocating a new one.

      Returns Point

    • Returns true if there are no verbs in the path.

      Returns boolean

    • Returns a new path that covers the same area as the original path, but with the Winding FillType. This may re-draw some contours in the path as counter-clockwise instead of clockwise to achieve that effect. If such a transformation cannot be done, null is returned.

      Returns Path | null

    • Returns the dashed version of this path. This is the same effect as creating a DashPathEffect and calling filterPath on this path.

      Parameters

      • on: number
      • off: number
      • phase: number

      Returns Path | null

    • Return the set of non-overlapping contours that describe the same area as this original path. The curve order is reduced where possible so that cubics may be turned into quadratics, and quadratics maybe turned into lines.

      Returns Path | null

    • Returns the the filled equivalent of the stroked path. Returns null if the operation fails (e.g. the path is a hairline).

      Parameters

      • Optionalopts: StrokeOpts

        describe how stroked path should look.

      Returns Path | null

    • Take start and stop "t" values (values between 0...1) and return a subset of this path. The trim values apply to the entire path, so if it contains several contours, all of them are including in the calculation. Null is returned if either input value is NaN.

      Parameters

      • startT: number

        a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.

      • stopT: number

        a value in the range [0.0, 1.0]. 1.0 is the end of the path.

      • isComplement: boolean

      Returns Path | null

    • Serializes the contents of this path as a series of commands. The first item will be a verb, followed by any number of arguments needed. Then it will be followed by another verb, more arguments and so on.

      Returns Float32Array

    • Returns this path as an SVG string.

      Returns string