skia
    Preparing search index...

    Interface ContourMeasure

    CanvasKit is built with Emscripten and Embind. Embind adds the following methods to all objects that are exposed with it. This _type field is necessary for the TypeScript compiler to differentiate between opaque types such as Shader and ColorFilter. It doesn't exist at runtime.

    interface ContourMeasure {
        _type: "ContourMeasure";
        delete(): void;
        deleteLater(): void;
        getPosTan(distance: number, output?: PosTan): PosTan;
        getSegment(startD: number, stopD: number, startWithMoveTo: boolean): Path;
        isAliasOf(other: any): boolean;
        isClosed(): boolean;
        isDeleted(): boolean;
        length(): number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _type: "ContourMeasure"

    Methods

    • Returns the given position and tangent line for the distance on the given contour. The return value is 4 floats in this order: posX, posY, vecX, vecY.

      Parameters

      • distance: number

        will be pinned between 0 and length().

      • Optionaloutput: PosTan

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

      Returns PosTan

    • Returns an Path representing the segement of this contour.

      Parameters

      • startD: number

        will be pinned between 0 and length()

      • stopD: number

        will be pinned between 0 and length()

      • startWithMoveTo: boolean

      Returns Path

    • Returns true if the contour is closed.

      Returns boolean

    • Returns the length of this contour.

      Returns number