画布填充颜色不能更改和撤回问题
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { generateId, optimizeCanvasRendering } from "../utils/helper";
|
||||
import { generateId, optimizeCanvasRendering, getLayerObjectsZIndex } from "../utils/helper";
|
||||
import { createLayer, LayerType, OperationType } from "../utils/layerHelper";
|
||||
import { Command } from "./Command";
|
||||
import i18n from "@/lang/index.ts";
|
||||
@@ -536,6 +536,12 @@ export class CreateTextCommand extends Command {
|
||||
if (this.textObject && this.canvas) {
|
||||
this.canvas.remove(this.textObject);
|
||||
}
|
||||
const layerObjects = getLayerObjectsZIndex(this.canvas, this.layerId);
|
||||
layerObjects.forEach((obj) => {
|
||||
if (obj.id === this.textObject?.id) {
|
||||
this.canvas.remove(obj.object);
|
||||
}
|
||||
});
|
||||
|
||||
// 智能移除创建的图层
|
||||
if (this.layerId && this.layerManager) {
|
||||
|
||||
Reference in New Issue
Block a user