画布选区缩略图更新问题

This commit is contained in:
李志鹏
2025-10-02 13:41:03 +08:00
parent 5fd9b6dc73
commit 10fc0dab10
3 changed files with 5 additions and 3 deletions

View File

@@ -116,7 +116,7 @@ export class AddLayerCommand extends Command {
parentLayer.children.splice(insertIndex, 0, newLayer);
console.log(
`新图层已插入到子图层位置: ${insertIndex} (父图层: ${parentLayer.name})`
`新图层已插入到子图层位置: ${insertIndex} (父图层: ${parentLayer.name})`, newLayer.fabricObjects.length
);
} else {
// 当前激活图层是一级图层
@@ -4197,6 +4197,7 @@ export class RemoveChildLayerCommand extends Command {
this.isActiveLayer = this.layerId === this.activeLayerId.value;
this.originalObjects = this.canvas.getObjects().filter((obj) => {
obj.parentId = this.parentId;
return obj.layerId === this.layerId;
});
}

View File

@@ -398,7 +398,7 @@ const handleToolClick = (tool) => {
.tools-list{
display: flex;
flex-direction: column;
gap: 1.0rem;
gap: 0.7rem;
flex: 1;
overflow-y: auto;
overflow-x: hidden;

View File

@@ -706,7 +706,8 @@ export class CanvasEventManager {
if (e.target.id) {
// 如果该元素是分组图层的一部分,也更新分组图层的缩略图
if (e.target.parentId) {
setTimeout(() => this.updateLayerThumbnail(e.target.parentId), 50);
// setTimeout(() => this.updateLayerThumbnail(e.target.parentId), 50);
this.thumbnailManager.generateLayerThumbnail(e.target.parentId);
}
}
}