Documentation
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _paint: Paint
    fillColor: Color
    height: number
    id: string
    locked: boolean
    opacity: number
    rotation: number
    scaleX: number
    scaleY: number
    strokeColor: Color
    strokeWidth: number
    visible: boolean
    width: number
    x: number
    y: number

    Accessors

    • get paint(): Paint

      Returns Paint

    • get shapeType(): string

      The shape type identifier for JSON serialization

      Returns string

    Methods

    • Parameters

      • forFill: boolean

      Returns void

    • Apply a resize operation given the new bounding box position and size. The default implementation sets x, y, width, height directly. Subclasses (e.g. PenShape) may override to use scaleX/scaleY instead.

      Parameters

      • x: number
      • y: number
      • w: number
      • h: number

      Returns void

    • Parameters

      • x: number
      • y: number

      Returns void

    • Draw the shape on the given canvas

      Parameters

      Returns void

    • Draw selection overlay: bounding box + handles, rotated with the shape.

      Parameters

      • canvas: Canvas

        the canvas to draw on (already inside the shape's canvas transform)

      • OptionalhandleSize: number

        handle square size in dp at 1× zoom

      • OptionaldisplayScale: number

        the effective display scale (canvasScale × matrix scale). Sizes are divided by this value so that handles appear constant-size on screen regardless of zoom.

      Returns void

    • Restore shape-specific data from JSON

      Parameters

      • _data: Record<string, any>

      Returns void

    • Get the 8 resize handles + 1 rotation handle in canvas (world) coordinates, accounting for rotation

      Parameters

      • displayScale: number

      Returns HandlePoint[]

    • Get bounding box in canvas space (accounting for position, scale and rotation is simplified as AABB)

      Parameters

      • displayScale: number

      Returns BoundingBox

    • Hit-test a point (in canvas coordinates) against the shape

      Parameters

      • px: number
      • py: number
      • Optionalscale: number

      Returns boolean

    • Notifies all the registered listeners for the property change event.

      Parameters

      • propertyName: string
      • value: any
      • OptionaloldValue: any

      Returns void

    • Shape-specific extra JSON data

      Returns Record<string, any>

    • Rotate a point around a center by angleDegrees, returning the new world position

      Parameters

      • px: number
      • py: number
      • cx: number
      • cy: number
      • angleDegrees: number

      Returns { x: number; y: number }