Classdesc

A helper for adding vertices to and remove vertices from Bézier paths. By default the 'delete' key is used to remove vertices or paths.

For convenience this helper is capable of handling multiple paths which are kept in an array.

Demo

Constructors

Properties

_keyHandler: KeyHandler
_mouseEnterListener: (() => void)

Type declaration

    • (): void
    • Returns void

_mouseHandler: MouseHandler
_mouseLeaveListener: (() => void)

Type declaration

    • (): void
    • Returns void

_touchHandler: AlloyFinger
allowPathRemoval: boolean
autoAdjustPaths: boolean
currentA: Vertex
currentB: Vertex
currentDistance: number
currentPathIndex: number
currentT: number
maxDetectDistance: number
mouseIsOver: boolean
onPathRemoved: OnPathRemoved
onPointerMoved: OnPointerMoved
onVertexInserted: OnVertexInserted
onVerticesDeleted: OnVerticesDeleted
paths: BezierPath[]

Member

pb

Memberof

BezierPathInteractionHelper

Instance

Methods

  • Manually add a path to this helper. Note that if autoAdjustPaths==true then listeners will be installed to the path's vertices to keep the path smooth at all times.

    Parameters

    Returns boolean

    Duplicate path instances cannot be added; function will return false if path already exists.

    Method

    addPath

    Instance

    Memberof

    BezierPathInteractionHelper

  • This function should invalidate any installed listeners and invalidate this object. After calling this function the object might not hold valid data any more and should not be used any more.

    Returns void

    Method

    destroy

    Instance

    Memberof

    BezierPathInteractionHelper

  • Manually remove a path from this helper. Note that this method ignores the allowPathRemoval option.

    Parameters

    Returns boolean

    Returns false if the path could not be found.

    Method

    removePath

    Instance

    Memberof

    BezierPathInteractionHelper

  • Remove the path at the given index.

    Parameters

    • pathIndex: number

      The index of the path (must be inside bounds, see this.paths array).

    Returns void

    Method

    removePathAt

    Instance

    Memberof

    BezierPathInteractionHelper

  • Update the inner status by running the distance calculation again with the current settings.

    Call this if any of the properties changed (like maxDetecDistance).

    Returns void

    Method

    update

    Instance

    Memberof

    BezierPathInteractionHelper

  • A helper function to add drag-end listeners to all vertices of the given path.

    Parameters

    • path: BezierPath

      The Bézier path to add vertex listeners to.

    • vertexDragEndListener: VertListener

      The drag listeners to add to each path vertex.

    Returns void

    void

    Static

    Method

    addPathVertexDragEndListeners

    Memberof

    BezierPathInteractionHelper

  • A helper function to add drag listeners to all vertices of the given path.

    Parameters

    • path: BezierPath

      The Bézier path to add vertex listeners to.

    • vertexDragListener: VertListener

      The drag listeners to add to each path vertex.

    Returns void

    void

    Static

    Method

    addPathVertexDragListeners

    Memberof

    BezierPathInteractionHelper

  • A helper function to add drag-start listeners to all vertices of the given path.

    Parameters

    • path: BezierPath

      The Bézier path to add vertex listeners to.

    • vertexDragStartListener: VertListener

      The drag listeners to add to each path vertex.

    Returns void

    void

    Static

    Method

    addPathVertexDragStartListeners

    Memberof

    BezierPathInteractionHelper

  • A helper function to remove drag-end listeners to all vertices of the given path.

    Parameters

    Returns void

    void

    Static

    Method

    removePathVertexDragEndListeners

    Memberof

    BezierPathInteractionHelper

  • A helper function to remove drag listeners to all vertices of the given path.

    Parameters

    • path: BezierPath

      The Bézier path to remove vertex listeners from.

    • vertexDragListener: VertListener

      The drag listeners to remove from each path vertex.

    Returns void

    void

    Static

    Method

    removePathVertexDragListeners

    Memberof

    BezierPathInteractionHelper

  • A helper function to remove drag-start listeners to all vertices of the given path.

    Parameters

    Returns void

    void

    Static

    Method

    removePathVertexDragStartListeners

    Memberof

    BezierPathInteractionHelper

Generated using TypeDoc