ShapeEditor

Shape editor.

Constructor

new ShapeEditor(app)

Parameters:
NameTypeDescription
appApp

The associated application.

Classes

ShapeEditor

Methods

disable()

Disable the editor. Redraws the layer.

enable()

Enable the editor. Redraws the layer.

getShape() → {Konva.Shape}

Get the edited shape.

Returns:

The edited shape.

Type: 
Konva.Shape

isActive() → {boolean}

Get the active flag.

Returns:

The active flag.

Type: 
boolean

reset()

Reset the editor.

resetAnchors()

Reset the anchors.

setAnchorsActive(flag)

Set anchors active.

Parameters:
NameTypeDescription
flagboolean

The active (on/off) flag.

setDrawEventCallback(callback)

Set the draw event callback.

Parameters:
NameTypeDescription
callbackeventFn

The callback.

setFactoryList(list)

Set the tool options.

Parameters:
NameTypeDescription
listArray

The list of shape classes.

setShape(inshape, drawLayer, viewController)

Set the shape to edit.

Parameters:
NameTypeDescription
inshapeKonva.Shape

The shape to edit.

drawLayerDrawLayer

The associated draw layer.

viewControllerViewController

The associated view controller.