Skip to main content

Class: SpatialContext

Manipulation.SpatialContext()

An in-memory model which has internal spacial representation of the strokes in a canvas. This kind ofspacial representation allows quick manipulations of the content.

Constructor

new SpatialContext()

Methods

add(stroke)

Associate stroke for further manipulations.Applicable for vector strokes only.

Parameters:
NameTypeDescription
strokeStroke

clone(inkModel) → Manipulation.SpatialContext

Provides copy of the current instance

Parameters:
NameTypeDescription
inkModelInkModel.InkModelInk model which state will be used for the new instance
Returns:

Spatial context copy

Type

Manipulation.SpatialContext

reload(stroke)

Update context after stroke transformation

Parameters:
NameTypeDescription
strokeStroke

remove(stroke)

Removes stroke from current context

Parameters:
NameTypeDescription
strokeStroke|stringStroke to remove or it's id

replace(stroke, strokes)

Replace stroke with one or more strokes

Parameters:
NameTypeDescription
strokeStrokeStroke to remove
strokesArray.<Stroke>Strokes to add

reset()

Clears context state

Home