Skip to content

Selection

通过鼠标选中Shape的 Action, 当使用 selection 插件的时候,这个 action 会在 selection 插件里被插件在每个Shape上边添加上。当然也可以自己在Shape实例上边添加此 action 来替换掉之前的 selection action,用于添加 initDrawFunc 来自定义 selection action 样式

Options

ts
export type SelectionActionOptions = {
	initDrawFunc?: SelectionDrawFunc
}

实例属性

selected

是否选中了当前Shape

实例方法

getSelectionPlugin

获取当前Selection插件实例

getSelectionShape

获取当前选中的Shape的 selection 的Svg.js的 shape 实例

getSelectionId

获取当前选中的Shape的 selection 的 id

disableSelection

禁用当前Selection插件

enableSelection

启用当前Selection插件

destroy

ImageMark 销毁时或者 unuseAction 时候调用