Skip to content

Controller

Controller

Constructors

new Controller()

new Controller(manipulator): Controller

Parameters

manipulator: Manipulator

Returns

Controller

Source

editor.ts:1506

Properties

dragPoint

dragPoint: number[]

Current drag point in shape’s LCS

Source

editor.ts:1454


dragPointCCS

dragPointCCS: number[]

Current drag point in shape’s CCS

Source

editor.ts:1464


dragPointGCS

dragPointGCS: number[]

Current drag point in shape’s GCS

Source

editor.ts:1459


dragPrevPoint

dragPrevPoint: number[]

Previous drag point in shape’s LCS

Source

editor.ts:1439


dragPrevPointCCS

dragPrevPointCCS: number[]

Previous drag point in shape’s CCS

Source

editor.ts:1449


dragPrevPointGCS

dragPrevPointGCS: number[]

Previous drag point in shape’s GCS

Source

editor.ts:1444


dragStartPoint

dragStartPoint: number[]

Drag start point in shape’s LCS

Source

editor.ts:1424


dragStartPointCCS

dragStartPointCCS: number[]

Drag start point in shape’s CCS

Source

editor.ts:1434


dragStartPointGCS

dragStartPointGCS: number[]

Drag start point in shape’s GCS

Source

editor.ts:1429


dragging

dragging: boolean = false

Indicates whether this controller is dragging or not

Source

editor.ts:1419


dx

dx: number = 0

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

Source

editor.ts:1469


dxGCS

dxGCS: number = 0

X-distance from dragStartPoint to dragPoint in GCS

Source

editor.ts:1489


dxStep

dxStep: number = 0

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

Source

editor.ts:1479


dxStepGCS

dxStepGCS: number = 0

X-distance from dragPrevPoint to dragPoint in GCS

Source

editor.ts:1499


dy

dy: number = 0

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

Source

editor.ts:1474


dyGCS

dyGCS: number = 0

Y-distance from dragStartPoint to dragPoint in GCS

Source

editor.ts:1494


dyStep

dyStep: number = 0

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

Source

editor.ts:1484


dyStepGCS

dyStepGCS: number = 0

Y-distance from dragPrevPoint to dragPoint in GCS

Source

editor.ts:1504


manipulator

manipulator: Manipulator

Source

editor.ts:1414

Methods

active()

active(editor, shape): boolean

Indicates the controller is active or not

Parameters

editor: Editor

shape: Shape

Returns

boolean

Source

editor.ts:1535


draw()

draw(editor, shape): void

Draw controller

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1564


drawDragging()

drawDragging(editor, shape, e): void

Draw on dragging

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1569


drawHovering()

drawHovering(editor, shape, e): void

Draw on hovering

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1574


finalize()

finalize(editor, shape): void

Finalize shape by ghost

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1589


initialize()

initialize(editor, shape): void

Initialize before dragging

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1579


keyDown()

keyDown(editor, shape, e): boolean

Handle keydown event

Parameters

editor: Editor

shape: Shape

e: KeyboardEvent

Returns

boolean

handled or not

Source

editor.ts:1680


keyUp()

keyUp(editor, shape, e): boolean

Handle keyup event

Parameters

editor: Editor

shape: Shape

e: KeyboardEvent

Returns

boolean

handled or not

Source

editor.ts:1694


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:1553


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:1543


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:1595


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:1627


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:1661


reset()

reset(): void

Returns

void

Source

editor.ts:1511


update()

update(editor, shape): void

Update ghost

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1584