feat: add override internal copy function api

This commit is contained in:
Hufe921
2023-10-22 18:05:50 +08:00
parent f4d75544d0
commit 45e7eab119
4 changed files with 27 additions and 0 deletions
+6
View File
@@ -3,6 +3,12 @@ import { CanvasEvent } from '../CanvasEvent'
export function copy(host: CanvasEvent) {
const draw = host.getDraw()
// 自定义粘贴事件
const { copy } = draw.getOverride()
if (copy) {
copy()
return
}
const rangeManager = draw.getRange()
// 光标闭合时复制整行
const copyElementList = rangeManager.getIsCollapsed()
+1
View File
@@ -1,3 +1,4 @@
export class Override {
public paste: ((evt: ClipboardEvent) => void) | undefined
public copy: (() => void) | undefined
}