Preparing search index...

    Class VectorPathBuilder

    A mutable builder for an immutable VectorPath. Add contours with moveTo and connect them with straight (lineTo) or curved (cubicTo, quadTo) segments, then call VectorPathBuilder#build to produce the path. A moveTo finalizes the current contour and begins a new one. Calling a draw method (lineTo/cubicTo/quadTo) before any moveTo starts a new contour at that target point. Coordinates are 2-component vectors [x, y].

    Lens Scripting Version 370

    var builder = VectorPathBuilder.create();
    builder.moveTo([0, 0]);
    builder.lineTo([1, 0]);
    builder.cubicTo([1, 0.5], [0.5, 1], [0, 1]);
    var path = builder.build();

    Hierarchy (View Summary)

    Index

    Methods

    • Captures the accumulated geometry and returns a new immutable VectorPath. The builder remains usable afterward; the returned path is an independent snapshot, so subsequent edits do not affect it.

      Returns VectorPath

      Lens Scripting Version 370

    • Adds a cubic Bezier segment from the current point through control points c1 and c2 to end. With no current point, behaves as a moveTo to end.

      Parameters

      Returns void

      Lens Scripting Version 370

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

      Lens Scripting Version 370

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    • Adds a straight segment from the current point to pt. With no current point, behaves as a moveTo to pt.

      Parameters

      Returns void

      Lens Scripting Version 370

    • Finalizes the current contour (if any) and begins a new contour at pt.

      Parameters

      Returns void

      Lens Scripting Version 370

    • Adds a quadratic Bezier segment from the current point through control point c to end. With no current point, behaves as a moveTo to end.

      Parameters

      Returns void

      Lens Scripting Version 370