Skip to content

Controller

Controller

Constructors

new Controller()

new Controller(manipulator): Controller

Parameters

manipulator: Manipulator

Returns

Controller

Source

editor.ts:1717

Properties

dragPoint

dragPoint: number[]

Current drag point in shape’s LCS

Source

editor.ts:1665


dragPointCCS

dragPointCCS: number[]

Current drag point in shape’s CCS

Source

editor.ts:1675


dragPointGCS

dragPointGCS: number[]

Current drag point in shape’s GCS

Source

editor.ts:1670


dragPrevPoint

dragPrevPoint: number[]

Previous drag point in shape’s LCS

Source

editor.ts:1650


dragPrevPointCCS

dragPrevPointCCS: number[]

Previous drag point in shape’s CCS

Source

editor.ts:1660


dragPrevPointGCS

dragPrevPointGCS: number[]

Previous drag point in shape’s GCS

Source

editor.ts:1655


dragStartPoint

dragStartPoint: number[]

Drag start point in shape’s LCS

Source

editor.ts:1635


dragStartPointCCS

dragStartPointCCS: number[]

Drag start point in shape’s CCS

Source

editor.ts:1645


dragStartPointGCS

dragStartPointGCS: number[]

Drag start point in shape’s GCS

Source

editor.ts:1640


dragging

dragging: boolean = false

Indicates whether this controller is dragging or not

Source

editor.ts:1630


dx

dx: number = 0

X-distance from dragStartPoint to dragPoint in shape’s LCS

Source

editor.ts:1680


dxGCS

dxGCS: number = 0

X-distance from dragStartPoint to dragPoint in GCS

Source

editor.ts:1700


dxStep

dxStep: number = 0

X-distance from dragPrevPoint to dragPoint in shape’s LCS

Source

editor.ts:1690


dxStepGCS

dxStepGCS: number = 0

X-distance from dragPrevPoint to dragPoint in GCS

Source

editor.ts:1710


dy

dy: number = 0

Y-distance from dragStartPoint to dragPoint in shape’s LCS

Source

editor.ts:1685


dyGCS

dyGCS: number = 0

Y-distance from dragStartPoint to dragPoint in GCS

Source

editor.ts:1705


dyStep

dyStep: number = 0

Y-distance from dragPrevPoint to dragPoint in shape’s LCS

Source

editor.ts:1695


dyStepGCS

dyStepGCS: number = 0

Y-distance from dragPrevPoint to dragPoint in GCS

Source

editor.ts:1715


hasHandle

hasHandle: boolean = false

Indicates whether this controller has handles or not

Source

editor.ts:1625


manipulator

manipulator: Manipulator

Source

editor.ts:1620

Methods

active()

active(editor, shape): boolean

Indicates the controller is active or not

Parameters

editor: Editor

shape: Shape

Returns

boolean

Source

editor.ts:1746


draw()

draw(editor, shape): void

Draw controller

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1775


drawDragging()

drawDragging(editor, shape, e): void

Draw on dragging

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1780


drawHovering()

drawHovering(editor, shape, e): void

Draw on hovering

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1785


finalize()

finalize(editor, shape, e): void

Finalize shape by ghost

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1800


initialize()

initialize(editor, shape, e): void

Initialize before dragging

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1790


keyDown()

keyDown(editor, shape, e): boolean

Handle keydown event

Parameters

editor: Editor

shape: Shape

e: KeyboardEvent

Returns

boolean

handled or not

Source

editor.ts:1891


keyUp()

keyUp(editor, shape, e): boolean

Handle keyup event

Parameters

editor: Editor

shape: Shape

e: KeyboardEvent

Returns

boolean

handled or not

Source

editor.ts:1905


mouseCursor()

mouseCursor(editor, shape, e): null | [string, number]

Returns mouse cursor for the controller

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

null | [string, number]

cursor object (null is default cursor)

Source

editor.ts:1764


mouseIn()

mouseIn(editor, shape, e): boolean

Returns true if mouse cursor is inside the controller. Default implementation returns true if the point inside the shape.

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

boolean

Source

editor.ts:1754


pointerDown()

pointerDown(editor, shape, e): boolean

Handle pointer down event

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

boolean

handled or not

Source

editor.ts:1806


pointerMove()

pointerMove(editor, shape, e): boolean

Handle pointer move event

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

boolean

handled or not

Source

editor.ts:1838


pointerUp()

pointerUp(editor, shape, e): boolean

Handle pointer up event

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

boolean

handled or not

Source

editor.ts:1872


reset()

reset(): void

Returns

void

Source

editor.ts:1722


update()

update(editor, shape, e): void

Update ghost

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1795