Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SelectTool

A class to add a selection tool. It allows to select and drag a shape.

Hierarchy

Index

Constructors

constructor

Properties

id

id: string = "select"

Id of the tool

isDown

isDown: boolean

Is the pointer down.

lastPoint

lastPoint: object

last point where the cursor was.

Type declaration

  • x: number
  • y: number

moved

moved: boolean

If true, a shape was dragged.

selectedShapes

selectedShapes: Shape[]

List of selected shapes

shape

shape: Shape

Shape being dragged.

Methods

keyUp

  • keyUp(e: KeyboardEvent, canvas: Canvas): void

pointerCancel

  • pointerCancel(e: PointerEvent, canvas: Canvas): void

pointerDown

  • pointerDown(e: PointerEvent, canvas: Canvas): void

pointerLeave

  • pointerLeave(e: PointerEvent, canvas: Canvas): void

pointerMove

  • pointerMove(e: PointerEvent, canvas: Canvas): void

pointerUp

  • pointerUp(e: PointerEvent, canvas: Canvas): void

Private selectShape

  • selectShape(shape: Shape): void

Protected setupUI

  • setupUI(toolBar: ToolBar, selected: boolean): void

toUnselect

  • toUnselect(): void

unselectAllShapes

  • unselectAllShapes(): void

unselectShape

  • unselectShape(shape: Shape): void

Generated using TypeDoc