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:
Name | Type | Description |
---|---|---|
stroke | Stroke |
clone(inkModel) → Manipulation.SpatialContext
Provides copy of the current instance
Parameters:
Name | Type | Description |
---|---|---|
inkModel | InkModel.InkModel | Ink model which state will be used for the new instance |
Returns:
Spatial context copy
Type
reload(stroke)
Update context after stroke transformation
Parameters:
Name | Type | Description |
---|---|---|
stroke | Stroke |
remove(stroke)
Removes stroke from current context
Parameters:
Name | Type | Description |
---|---|---|
stroke | Stroke|string | Stroke to remove or it's id |
replace(stroke, strokes)
Replace stroke with one or more strokes
Parameters:
Name | Type | Description |
---|---|---|
stroke | Stroke | Stroke to remove |
strokes | Array.<Stroke> | Strokes to add |
reset()
Clears context state