MarkupSelected Class

The set of currently selected SVG elements. When elements are added to the set, they are hilited.

Methods

Name Description
constructor(svg: @svgdotjs/svg.js.G): MarkupSelected    
add(el: @svgdotjs/svg.js.Element): void Add a new element to the SS  
clearEditors(): void    
deleteAll(undo: UndoManager): void    
drop(el: @svgdotjs/svg.js.Element): boolean Remove an element from the selection set and unhilite it.  
emptyAll(): void    
groupAll(undo: UndoManager): void    
has(el: @svgdotjs/svg.js.Element): boolean    
replace(oldEl: @svgdotjs/svg.js.Element, newEl: @svgdotjs/svg.js.Element): void Replace an entry in the selection set with a different element.  
reposition(cmdName: string, undo: UndoManager, fn: (el: @svgdotjs/svg.js.Element) => void): void Move all of the entries to a new position in the DOM via a callback.  
restart(el?: @svgdotjs/svg.js.Element): void    
sizeChanged(): void    
ungroupAll(undo: UndoManager): void    

Properties

Name Type Description
elements Readonly Set<@svgdotjs/svg.js.Element>    
handles Handles | undefined    
isEmpty Accessor ReadOnly boolean    
onChanged Readonly BeEvent<(selected: MarkupSelected) => void> Called whenever elements are added or removed from this SelectionSet  
size Accessor ReadOnly number    
svg @svgdotjs/svg.js.G    

Defined in

Last Updated: 23 November, 2024