feat: 更新红绿图设置逻辑,支持根据图像模式调整属性;修复笔刷类型同步问题
This commit is contained in:
@@ -458,10 +458,22 @@ export class BatchInitializeRedGreenModeCommand extends Command {
|
|||||||
throw new Error("衣服底图未加载,无法设置红绿图位置");
|
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({
|
img.set({
|
||||||
scaleX: clothingImage.scaleX,
|
|
||||||
scaleY: clothingImage.scaleY,
|
|
||||||
left: clothingImage.left,
|
left: clothingImage.left,
|
||||||
top: clothingImage.top,
|
top: clothingImage.top,
|
||||||
originX: clothingImage.originX,
|
originX: clothingImage.originX,
|
||||||
|
|||||||
@@ -451,7 +451,9 @@ export class ToolManager {
|
|||||||
this.brushManager.setBrushOpacity(BrushStore.state.opacity);
|
this.brushManager.setBrushOpacity(BrushStore.state.opacity);
|
||||||
|
|
||||||
// 同步笔刷类型 - 修复方法名,使用正确的setBrushType方法
|
// 同步笔刷类型 - 修复方法名,使用正确的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) {
|
if (BrushStore.state.textureEnabled && BrushStore.state.texturePath) {
|
||||||
|
|||||||
Reference in New Issue
Block a user