深度画布橡皮擦记录

This commit is contained in:
lzp
2026-03-27 09:50:09 +08:00
parent b3aedd3fce
commit 43cf097a2a
2 changed files with 20 additions and 2 deletions

View File

@@ -753,6 +753,23 @@ export class CanvasEventManager {
this.canvas.on("object:removed", (e) => {
// updateLayers(e);
});
this.canvas.on("erasing:start", (e) => {
// console.log("erasing:start", e);
});
this.canvas.on("erasing:end", async (e) => {
// console.log("erasing:end", e);
const targets = e.targets;
var isRecord = false;
for (let i = 0; i < targets.length; i++) {
const target = targets[i];
const id = target?.info?.id;
if (id) {
isRecord = true;
await this.layerManager.updateLayerThumbnailsById(id)
}
}
if (isRecord) this.stateManager.recordState();
});
}
setupDoubleClickEvents() {
// 双击处理