From 2446f91376defca6e767e72386f45a0b5cbd068d Mon Sep 17 00:00:00 2001 From: bighuixiang <472705331@qq.com> Date: Mon, 23 Jun 2025 18:01:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=BA=A2=E7=BB=BF?= =?UTF-8?q?=E5=9B=BE=E8=AE=BE=E7=BD=AE=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=A0=B9=E6=8D=AE=E5=9B=BE=E5=83=8F=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B1=9E=E6=80=A7=EF=BC=9B=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=AC=94=E5=88=B7=E7=B1=BB=E5=9E=8B=E5=90=8C=E6=AD=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CanvasEditor/commands/RedGreenCommands.js | 18 +++++++++++++++--- .../CanvasEditor/managers/ToolManager.js | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/component/Canvas/CanvasEditor/commands/RedGreenCommands.js b/src/component/Canvas/CanvasEditor/commands/RedGreenCommands.js index b060c0cc..6c68b54f 100644 --- a/src/component/Canvas/CanvasEditor/commands/RedGreenCommands.js +++ b/src/component/Canvas/CanvasEditor/commands/RedGreenCommands.js @@ -458,10 +458,22 @@ export class BatchInitializeRedGreenModeCommand extends Command { throw new Error("衣服底图未加载,无法设置红绿图位置"); } - // 使用与衣服底图完全相同的属性 + if (this.clothingImageOpts?.imageMode) { + imageModeHandler({ + imageMode: this.clothingImageOpts?.imageMode, + newImage: img, + canvasWidth: this.canvas.width, + canvasHeight: this.canvas.height, + }); + } else { + // 使用与衣服底图完全相同的属性 + img.set({ + scaleX: clothingImage.scaleX, + scaleY: clothingImage.scaleY, + }); + } + img.set({ - scaleX: clothingImage.scaleX, - scaleY: clothingImage.scaleY, left: clothingImage.left, top: clothingImage.top, originX: clothingImage.originX, diff --git a/src/component/Canvas/CanvasEditor/managers/ToolManager.js b/src/component/Canvas/CanvasEditor/managers/ToolManager.js index ac43d4bf..c6d46561 100644 --- a/src/component/Canvas/CanvasEditor/managers/ToolManager.js +++ b/src/component/Canvas/CanvasEditor/managers/ToolManager.js @@ -451,7 +451,9 @@ export class ToolManager { this.brushManager.setBrushOpacity(BrushStore.state.opacity); // 同步笔刷类型 - 修复方法名,使用正确的setBrushType方法 - this.brushManager.setBrushType(BrushStore.state.type); + this.brushManager.setBrushType( + BrushStore.state.type === "eraser" ? "pencil" : BrushStore.state.type + ); // 同步材质设置 if (BrushStore.state.textureEnabled && BrushStore.state.texturePath) {