深度画布橡皮擦记录
This commit is contained in:
@@ -221,12 +221,13 @@ export class AISelectboxToolManager {
|
||||
if (!this.demoObject) return
|
||||
const fobject = this.demoObject
|
||||
this.clearDemoObject()
|
||||
const canvas = getObjectAlphaToCanvas(fobject, null, 0, { r: 255, g: 0, b: 0, a: 255 });
|
||||
const tcanvas = await this.createStaticCanvas(fobject)
|
||||
const canvas = getObjectAlphaToCanvas(tcanvas, null, 0, { r: 255, g: 0, b: 0, a: 255 });
|
||||
const arr = traceImageContour(canvas);
|
||||
const scaleY = fobject.scaleY
|
||||
const scaleX = fobject.scaleX
|
||||
const top = fobject.top
|
||||
const left = fobject.left
|
||||
const arr = traceImageContour(canvas);
|
||||
let minX = fobject.width;
|
||||
let minY = fobject.height;
|
||||
const str = arr.map((v) => {
|
||||
|
||||
@@ -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() {
|
||||
// 双击处理
|
||||
|
||||
Reference in New Issue
Block a user