turbodombuilder - v0.9.5
    Preparing search index...

    Class TurboDragEvent

    TurboDragEvent

    Turbo drag event class, fired on turbo-drag, turbo-drag-start, turbo-drag-end, etc.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    origins: TurboMap<number, Point>

    Map containing the origins of the dragging points

    previousPositions: TurboMap<number, Point>

    Map containing the previous positions of the dragging points

    positions: TurboMap<number, Point>

    Map containing the positions of the dragging points

    eventManager: TurboEventManager

    The event manager that fired this event.

    toolName: string

    The name of the tool (if any) associated with this event.

    The name of the event.

    clickMode: ClickMode

    The click mode of the fired event

    keys: string[]

    The keys pressed when the event was fired

    position: Point

    The screen position from where the event was fired

    authorizeScaling: boolean | (() => boolean)

    Callback function (or boolean) to be overridden to specify when to allow transformation and/or scaling.

    scalePosition: (position: Point) => Point

    Callback function to be overridden to specify how to transform a position from screen to document space.

    Accessors

    • get scaledOrigins(): TurboMap<number, Point>

      Returns TurboMap<number, Point>

      Map of the origins mapped to the current canvas translation and scale

    • get scaledPreviousPositions(): TurboMap<number, Point>

      Returns TurboMap<number, Point>

      Map of the previous positions mapped to the current canvas translation and scale

    • get scaledPositions(): TurboMap<number, Point>

      Returns TurboMap<number, Point>

      Map of the positions mapped to the current canvas translation and scale

    • get deltaPositions(): TurboMap<number, Point>

      Returns TurboMap<number, Point>

    • get deltaPosition(): Point

      Returns Point

    • get scaledDeltaPositions(): TurboMap<number, Point>

      Returns TurboMap<number, Point>

    • get scaledDeltaPosition(): Point

      Returns Point

    • get tool(): Node

      Returns Node

      The tool (if any) associated with this event.

    • get target(): Element | Document

      Returns Element | Document

      The target of the event (as an Element - or the document)

    • get scaledPosition(): Point

      Returns Point

      The position of the fired event transformed and/or scaled using the class's scalePosition().

    • get scalingAuthorized(): boolean

      Returns boolean

      Specifies whether to allow transformation and/or scaling.

    Methods

    • Type Parameters

      Parameters

      • type: new (...args: any[]) => T
      • strict: boolean | Element = true
      • from: ClosestOrigin = ClosestOrigin.target

      Returns T

      Returns the closest element of the provided type to the target (Searches through the element and all its parents to find one of matching type).