深度画布

This commit is contained in:
lzp
2026-03-24 11:49:53 +08:00
parent ef13f815f9
commit a7812a250e
15 changed files with 95 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
import { fabric } from 'fabric-with-all'
import { OperationType } from '../tools/layerHelper'
import { OperationType, AI_SELECTBOX_TYPE } from '../tools/layerHelper'
import { getObjectAlphaToCanvas, traceImageContour } from '../tools/canvasMethod'
/** 智能框选工具管理器 */
@@ -20,6 +20,15 @@ export class AISelectboxToolManager {
this.layerManager = options.layerManager
this.toolManager = options.toolManager
}
/** 处理切换工具 */
handleToolChange(oldTool: string, newTool: string) {
if (newTool === OperationType.SELECTBOX) {
// 切换到智能框选工具
} else {
// 切换到普通框选工具
}
}
mouseDownEvent(e) {
this.isDragging = true
this.startX = e.absolutePointer.x
@@ -65,7 +74,7 @@ export class AISelectboxToolManager {
this.canvasManager.canvas.remove(this.demoObject)
this.canvasManager.canvas.renderAll()
this.createSelectbox()
// this.createSelectbox()
}