Controller
Controller
Constructors
new Controller()
new Controller(
manipulator
):Controller
Parameters
• manipulator: Manipulator
Returns
Source
packages/core/src/editor.ts:1733
Properties
dragPoint
dragPoint:
number
[]
Current drag point in shape’s LCS
Source
packages/core/src/editor.ts:1681
dragPointCCS
dragPointCCS:
number
[]
Current drag point in shape’s CCS
Source
packages/core/src/editor.ts:1691
dragPointGCS
dragPointGCS:
number
[]
Current drag point in shape’s GCS
Source
packages/core/src/editor.ts:1686
dragPrevPoint
dragPrevPoint:
number
[]
Previous drag point in shape’s LCS
Source
packages/core/src/editor.ts:1666
dragPrevPointCCS
dragPrevPointCCS:
number
[]
Previous drag point in shape’s CCS
Source
packages/core/src/editor.ts:1676
dragPrevPointGCS
dragPrevPointGCS:
number
[]
Previous drag point in shape’s GCS
Source
packages/core/src/editor.ts:1671
dragStartPoint
dragStartPoint:
number
[]
Drag start point in shape’s LCS
Source
packages/core/src/editor.ts:1651
dragStartPointCCS
dragStartPointCCS:
number
[]
Drag start point in shape’s CCS
Source
packages/core/src/editor.ts:1661
dragStartPointGCS
dragStartPointGCS:
number
[]
Drag start point in shape’s GCS
Source
packages/core/src/editor.ts:1656
dragging
dragging:
boolean
=false
Indicates whether this controller is dragging or not
Source
packages/core/src/editor.ts:1646
dx
dx:
number
=0
X-distance from dragStartPoint to dragPoint in shape’s LCS
Source
packages/core/src/editor.ts:1696
dxGCS
dxGCS:
number
=0
X-distance from dragStartPoint to dragPoint in GCS
Source
packages/core/src/editor.ts:1716
dxStep
dxStep:
number
=0
X-distance from dragPrevPoint to dragPoint in shape’s LCS
Source
packages/core/src/editor.ts:1706
dxStepGCS
dxStepGCS:
number
=0
X-distance from dragPrevPoint to dragPoint in GCS
Source
packages/core/src/editor.ts:1726
dy
dy:
number
=0
Y-distance from dragStartPoint to dragPoint in shape’s LCS
Source
packages/core/src/editor.ts:1701
dyGCS
dyGCS:
number
=0
Y-distance from dragStartPoint to dragPoint in GCS
Source
packages/core/src/editor.ts:1721
dyStep
dyStep:
number
=0
Y-distance from dragPrevPoint to dragPoint in shape’s LCS
Source
packages/core/src/editor.ts:1711
dyStepGCS
dyStepGCS:
number
=0
Y-distance from dragPrevPoint to dragPoint in GCS
Source
packages/core/src/editor.ts:1731
hasHandle
hasHandle:
boolean
=false
Indicates whether this controller has handles or not
Source
packages/core/src/editor.ts:1641
manipulator
manipulator:
Manipulator
Source
packages/core/src/editor.ts:1636
Methods
active()
active(
editor
,shape
):boolean
Indicates the controller is active or not
Parameters
• editor: Editor
• shape: Shape
Returns
boolean
Source
packages/core/src/editor.ts:1762
draw()
draw(
editor
,shape
):void
Draw controller
Parameters
• editor: Editor
• shape: Shape
Returns
void
Source
packages/core/src/editor.ts:1791
drawDragging()
drawDragging(
editor
,shape
,e
):void
Draw on dragging
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
packages/core/src/editor.ts:1796
drawHovering()
drawHovering(
editor
,shape
,e
):void
Draw on hovering
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
packages/core/src/editor.ts:1801
finalize()
finalize(
editor
,shape
,e
):void
Finalize shape by ghost
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
packages/core/src/editor.ts:1816
initialize()
initialize(
editor
,shape
,e
):void
Initialize before dragging
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
packages/core/src/editor.ts:1806
keyDown()
keyDown(
editor
,shape
,e
):boolean
Handle keydown event
Parameters
• editor: Editor
• shape: Shape
• e: KeyboardEvent
Returns
boolean
handled or not
Source
packages/core/src/editor.ts:1907
keyUp()
keyUp(
editor
,shape
,e
):boolean
Handle keyup event
Parameters
• editor: Editor
• shape: Shape
• e: KeyboardEvent
Returns
boolean
handled or not
Source
packages/core/src/editor.ts:1921
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
packages/core/src/editor.ts:1780
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
packages/core/src/editor.ts:1770
pointerDown()
pointerDown(
editor
,shape
,e
):boolean
Handle pointer down event
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
handled or not
Source
packages/core/src/editor.ts:1822
pointerMove()
pointerMove(
editor
,shape
,e
):boolean
Handle pointer move event
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
handled or not
Source
packages/core/src/editor.ts:1854
pointerUp()
pointerUp(
editor
,shape
,e
):boolean
Handle pointer up event
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
handled or not
Source
packages/core/src/editor.ts:1888
reset()
reset():
void
Returns
void
Source
packages/core/src/editor.ts:1738
update()
update(
editor
,shape
,e
):void
Update ghost
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void