Skip to content

SelectionManager

Selection Manager

Constructors

new SelectionManager()

new SelectionManager(editor): SelectionManager

Parameters

editor: Editor

Returns

SelectionManager

Source

selection-manager.ts:15

Properties

editor

editor: Editor

Source

selection-manager.ts:11


onChange

onChange: TypedEvent<Shape[]>

Source

selection-manager.ts:13


shapes

shapes: Shape[]

Source

selection-manager.ts:12

Methods

deselect()

deselect(shapes): void

Deselect the given shapes.

Parameters

shapes: Shape[]

Returns

void

Source

selection-manager.ts:125


deselectAll()

deselectAll(): void

Deselect all shapes.

Returns

void

Source

selection-manager.ts:137


getBoundingRect()

getBoundingRect(canvas): number[][]

Returns bounding rect of selected shapes

Parameters

canvas: Canvas

Returns

number[][]

Source

selection-manager.ts:147


getEnclosure()

getEnclosure(canvas): number[][]

Returns enclosure of selected shapes

Parameters

canvas: Canvas

Returns

number[][]

Source

selection-manager.ts:165


getShapes()

getShapes(): Shape[]

Return selected shapes.

Returns

Shape[]

an array of selected shapes.

Source

selection-manager.ts:45


isChanged()

isChanged(shapes): boolean

isChanged

Parameters

shapes: Shape[]

Returns

boolean

Source

selection-manager.ts:24


isSelected()

isSelected(shape): boolean

Parameters

shape: Shape

Returns

boolean

Source

selection-manager.ts:56


select()

select(shapes, clear): void

Select shapes

Parameters

shapes: Shape[]

an array of shapes to be selected.

clear: boolean= true

clear the current selection if true.

Returns

void

Source

selection-manager.ts:65


selectAll()

selectAll(): void

Select all shapes in the current page

Returns

void

Source

selection-manager.ts:112


selectArea()

selectArea(x1, y1, x2, y2, clear): void

Select shapes overlap the given area in the current page.

Parameters

x1: number

x-coordinate of the first corner of the area.

y1: number

y-coordinate of the first corner of the area.

x2: number

x-coordinate of the second corner of the area.

y2: number

y-coordinate of the second corner of the area.

clear: boolean= true

clear the current selection if true.

Returns

void

Source

selection-manager.ts:83


size()

size(): number

Return the number of selections

Returns

number

Source

selection-manager.ts:52