fix: 修复多个已知问题

This commit is contained in:
bighuixiang
2025-06-29 23:29:47 +08:00
parent 6fc2a8fc57
commit 4a95f27966
41 changed files with 2266 additions and 351 deletions

View File

@@ -103,7 +103,7 @@ export class LayerManager {
this.canvasHeight = options.canvasHeight || 600;
// 默认背景颜色
this.backgroundColor = options.backgroundColor || "#ffffff";
this.backgroundColor = options.backgroundColor || { value: "#ffffff" };
// 复制粘贴相关
this.clipboardData = null;
@@ -428,7 +428,7 @@ export class LayerManager {
name: name,
canvasWidth: this.canvasWidth,
canvasHeight: this.canvasHeight,
backgroundColor: this.backgroundColor,
backgroundColor: this.backgroundColor.value,
});
// 直接创建和执行命令
@@ -1388,7 +1388,7 @@ export class LayerManager {
activeLayerId: this.activeLayerId.value,
canvasWidth: this.canvasWidth,
canvasHeight: this.canvasHeight,
backgroundColor: this.backgroundColor,
backgroundColor: this.backgroundColor.value,
editorMode: this.editorMode,
};
}
@@ -1724,7 +1724,6 @@ export class LayerManager {
* @param {string} backgroundColor 背景颜色
*/
updateBackgroundColor(backgroundColor) {
// 查找背景图层
const backgroundLayer = this.layers.value.find(
(layer) => layer.isBackground
);
@@ -1739,7 +1738,8 @@ export class LayerManager {
canvas: this.canvas,
layers: this.layers,
canvasManager: this.canvasManager,
backgroundColor: backgroundColor,
backgroundColor,
backgroundColorValue: this.backgroundColor,
});
// 执行命令
@@ -1748,9 +1748,6 @@ export class LayerManager {
} else {
command.execute();
}
// 更新存储的背景颜色
this.backgroundColor = backgroundColor;
}
/**