Skip to content

Controller

Controller

Constructors

new Controller()

new Controller(manipulator): Controller

Parameters

manipulator: Manipulator

Returns

Controller

Source

editor.ts:1701

Properties

dragPoint

dragPoint: number[]

Current drag point in shape’s LCS

Source

editor.ts:1649


dragPointCCS

dragPointCCS: number[]

Current drag point in shape’s CCS

Source

editor.ts:1659


dragPointGCS

dragPointGCS: number[]

Current drag point in shape’s GCS

Source

editor.ts:1654


dragPrevPoint

dragPrevPoint: number[]

Previous drag point in shape’s LCS

Source

editor.ts:1634


dragPrevPointCCS

dragPrevPointCCS: number[]

Previous drag point in shape’s CCS

Source

editor.ts:1644


dragPrevPointGCS

dragPrevPointGCS: number[]

Previous drag point in shape’s GCS

Source

editor.ts:1639


dragStartPoint

dragStartPoint: number[]

Drag start point in shape’s LCS

Source

editor.ts:1619


dragStartPointCCS

dragStartPointCCS: number[]

Drag start point in shape’s CCS

Source

editor.ts:1629


dragStartPointGCS

dragStartPointGCS: number[]

Drag start point in shape’s GCS

Source

editor.ts:1624


dragging

dragging: boolean = false

Indicates whether this controller is dragging or not

Source

editor.ts:1614


dx

dx: number = 0

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

Source

editor.ts:1664


dxGCS

dxGCS: number = 0

X-distance from dragStartPoint to dragPoint in GCS

Source

editor.ts:1684


dxStep

dxStep: number = 0

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

Source

editor.ts:1674


dxStepGCS

dxStepGCS: number = 0

X-distance from dragPrevPoint to dragPoint in GCS

Source

editor.ts:1694


dy

dy: number = 0

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

Source

editor.ts:1669


dyGCS

dyGCS: number = 0

Y-distance from dragStartPoint to dragPoint in GCS

Source

editor.ts:1689


dyStep

dyStep: number = 0

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

Source

editor.ts:1679


dyStepGCS

dyStepGCS: number = 0

Y-distance from dragPrevPoint to dragPoint in GCS

Source

editor.ts:1699


hasHandle

hasHandle: boolean = false

Indicates whether this controller has handles or not

Source

editor.ts:1609


manipulator

manipulator: Manipulator

Source

editor.ts:1604

Methods

active()

active(editor, shape): boolean

Indicates the controller is active or not

Parameters

editor: Editor

shape: Shape

Returns

boolean

Source

editor.ts:1730


draw()

draw(editor, shape): void

Draw controller

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1759


drawDragging()

drawDragging(editor, shape, e): void

Draw on dragging

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1764


drawHovering()

drawHovering(editor, shape, e): void

Draw on hovering

Parameters

editor: Editor

shape: Shape

e: CanvasPointerEvent

Returns

void

Source

editor.ts:1769


finalize()

finalize(editor, shape): void

Finalize shape by ghost

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1784


initialize()

initialize(editor, shape): void

Initialize before dragging

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1774


keyDown()

keyDown(editor, shape, e): boolean

Handle keydown event

Parameters

editor: Editor

shape: Shape

e: KeyboardEvent

Returns

boolean

handled or not

Source

editor.ts:1875


keyUp()

keyUp(editor, shape, e): boolean

Handle keyup event

Parameters

editor: Editor

shape: Shape

e: KeyboardEvent

Returns

boolean

handled or not

Source

editor.ts:1889


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


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


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


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


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


reset()

reset(): void

Returns

void

Source

editor.ts:1706


update()

update(editor, shape): void

Update ghost

Parameters

editor: Editor

shape: Shape

Returns

void

Source

editor.ts:1779