Selection
The current selection. Changing it doesn’t need an operation and isn’t undoable. Only live drawing elements in the active editing context can be selected.
Implements
Section titled “Implements”Iterable<AnyDrawingElement>
Properties
Section titled “Properties”length
Section titled “length”
readonlylength:number
Number of selected elements.
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<AnyDrawingElement>
Returns
Section titled “Returns”Iterator<AnyDrawingElement>
Implementation of
Section titled “Implementation of”Iterable.[iterator]
add(
entity):boolean
Adds an element. Returns whether it wasn’t selected before.
Parameters
Section titled “Parameters”entity
Section titled “entity”Returns
Section titled “Returns”boolean
at(
index):AnyDrawingElement|undefined
Returns the selected element at index, counting from the end when negative.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”AnyDrawingElement | undefined
clear()
Section titled “clear()”clear():
void
Deselects everything.
Returns
Section titled “Returns”void
has(
entity):boolean
Whether the element is selected.
Parameters
Section titled “Parameters”entity
Section titled “entity”Returns
Section titled “Returns”boolean
remove()
Section titled “remove()”remove(
entity):boolean
Removes an element. Returns whether it was selected.
Parameters
Section titled “Parameters”entity
Section titled “entity”Returns
Section titled “Returns”boolean
toArray()
Section titled “toArray()”toArray():
AnyDrawingElement[]
A snapshot of the selected elements.