部件选取

This commit is contained in:
李志鹏
2026-01-26 16:16:40 +08:00
parent ba49b02ebe
commit 9cecbdcf9b
11 changed files with 245 additions and 144 deletions

View File

@@ -106,7 +106,6 @@ export class FillGroupLayerBackgroundCommand extends Command {
});
}
}
// 判断fabricObjects是否是组对象
const firstObj = layer.fabricObjects?.[0] || null;
// 如果没有找到第一个对象,则直接添加到当前画布
@@ -173,8 +172,8 @@ export class FillGroupLayerBackgroundCommand extends Command {
}
const canvasObj = findObjectById(this.canvas, firstObj?.id)?.object;
if (
(canvasObj && canvasObj.type === "group") ||
canvasObj._objects?.length > 0
canvasObj && (canvasObj.type === "group" ||
canvasObj._objects?.length > 0)
) {
this.newFill.set({
left: 0,