深度画布功能

This commit is contained in:
lzp
2026-03-11 15:34:56 +08:00
parent 5e063f919d
commit c87ed70e7c
46 changed files with 12646 additions and 224 deletions

View File

@@ -43,7 +43,7 @@ export class CanvasEventManager {
}
// 共享事件
// this.setupSelectionEvents();
this.setupSelectionEvents();
// this.setupObjectEvents();
// this.setupDoubleClickEvents();
@@ -228,7 +228,7 @@ export class CanvasEventManager {
if (this.lastMousePositions.length > this.positionHistoryLimit) {
this.lastMousePositions.shift();
}
this.canvas.setViewportTransform(vpt);
this.canvas.renderAll();
this.canvas.lastPosX = opt.e.clientX;
this.canvas.lastPosY = opt.e.clientY;
@@ -429,7 +429,7 @@ export class CanvasEventManager {
this.touchState.lastTouchTime = now;
}
this.canvas.setViewportTransform(vpt);
this.canvas.requestRenderAll(); // 使用requestRenderAll代替renderAll
this.canvas.lastPosX = currentX;
this.canvas.lastPosY = currentY;
@@ -616,7 +616,8 @@ export class CanvasEventManager {
if (this.toolManager) {
// this.toolManager.restoreSelectionState(); // 恢复选择状态
}
const vpt = this.canvas.viewportTransform;
this.canvas.setViewportTransform(vpt);
this.canvas.renderAll();
}
@@ -878,7 +879,7 @@ export class CanvasEventManager {
updateSelectedLayer(opt) {
const selected = opt.selected[0];
if (selected) {
this.layerManager.activeLayerId.value = selected.layerId;
this.layerManager.setActiveID(selected?.info?.id, false)
}
}
@@ -1068,7 +1069,7 @@ export class CanvasEventManager {
const vpt = this.canvas.viewportTransform;
vpt[4] += e.pageX - this.canvas.lastPosX;
vpt[5] += e.pageY - this.canvas.lastPosY;
this.canvas.setViewportTransform(vpt);
this.canvas.renderAll();
this.canvas.lastPosX = e.pageX;
this.canvas.lastPosY = e.pageY;