iink-ts - v5.0.0
    Preparing search index...

    Class InsertGestureHandler

    Handler for INSERT gesture type Inserts line breaks or space by drawing vertical line

    Hierarchy (View Summary)

    Index
    • get client(): WebSocketClient

      Get the canvas's client

      Returns WebSocketClient

    • get history(): IIHistoryManager

      Get the canvas's history manager

      Returns IIHistoryManager

    • get manager(): IIGestureManager

      Get the canvas's model

      Returns IIGestureManager

    • get model(): IIModel

      Get the canvas's model

      Returns IIModel

    • get renderer(): SVGRenderer

      Get the canvas's renderer

      Returns SVGRenderer

    • get rowHeight(): number

      Get the row height from configuration

      Returns number

    • get strokeSpaceWidth(): number

      Get the stroke space width from configuration

      Returns number

    • get translator(): IITranslateManager

      Get the canvas's translator manager

      Returns IITranslateManager

    • get typeset(): IITypesetManager

      Get the canvas's typeset manager

      Returns IITypesetManager

    • Apply the gesture to the model

      Parameters

      • gestureStroke: TStroke

        The stroke that forms the gesture

      • gesture: TGesture

        The detected gesture information

      Returns Promise<void>

      Promise that resolves when the gesture is applied

    • Compute changes needed when splitting a stroke Handles both simple Stroke symbols with child strokes

      Parameters

      • gestureStroke: TStroke

        The gesture stroke

      • strokeIdToSplit: string

        ID of the stroke to split

      • subStrokes: { fullStrokeId: string; x: number[]; y: number[] }[]

        Substroke data

      Returns TSplitOutcome

      History changes object with translate and replaced arrays

    • Compute changes when splitting a Text symbol

      Parameters

      • gestureStroke: TStroke

        The gesture stroke

      • textToSplit: TText

        The text symbol to split

      • insertAction: InsertAction

        The insert action mode

      Returns TSplitOutcome

      History changes object

    • Compute split stroke into before/after parts Applies translation to the "after" stroke

      Parameters

      • strokeOrigin: TStroke

        The original stroke to split

      • subStrokes: { x: number[]; y: number[] }[]

        Array of substroke data

      Returns { after?: TStroke; before?: TStroke }

      Object with optional before and after strokes

    • Create strokes from gesture substrokes Reconstructs pointers with pressure and time information

      Parameters

      • strokeOrigin: TStroke

        The original stroke to get style and pointer info

      • subStrokes: { x: number[]; y: number[] }[]

        Array of substroke data (x,y coordinates)

      Returns TStroke[]

      Array of new strokes

    • The dt the pointer at index had in the stroke being split, or one step past the last pointer already kept when the split runs off the end of the original.

      ?? and not ||: the first pointer of a stroke has a dt of exactly 0, and || would read that as missing and fabricate a time for a pointer that has a perfectly good one.

      Parameters

      Returns number

    gestureType: "INSERT" = ...

    The type of gesture this handler manages

    logger: Logger