feat: 实时更新背景色+选取剪切+选取删除初步开发完成

This commit is contained in:
bighuixiang
2025-07-03 00:04:05 +08:00
parent eb1848bd6d
commit b6afd2764d
8 changed files with 1130 additions and 106 deletions

View File

@@ -1753,7 +1753,7 @@ export class LayerManager {
* 更新背景图层颜色
* @param {string} backgroundColor 背景颜色
*/
updateBackgroundColor(backgroundColor) {
updateBackgroundColor(backgroundColor, options = {}) {
const backgroundLayer = this.layers.value.find(
(layer) => layer.isBackground
);
@@ -1768,10 +1768,14 @@ export class LayerManager {
canvas: this.canvas,
layers: this.layers,
canvasManager: this.canvasManager,
layerManger: this,
backgroundColor,
backgroundColorValue: this.backgroundColor,
oldColor: options.oldColor,
});
command.undoable = isBoolean(options.undoable) ? options.undoable : true; // 设置为可撤销
// 执行命令
if (this.commandManager) {
this.commandManager.execute(command);