From 8ff7a31e925e1469b56143a31e9f322c5bd408ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com>
Date: Mon, 26 Jan 2026 17:07:06 +0800
Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E4=BB=B6=E9=80=89=E5=8F=96=E5=A4=9A?=
=?UTF-8?q?=E8=AF=AD=E8=A8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/PartSelectorPanel.vue | 18 +++++++++---------
.../CanvasEditor/managers/PartManager.js | 3 ++-
src/lang/cn.ts | 6 ++++++
src/lang/en.ts | 6 ++++++
4 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue b/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue
index e947e730..1bf5d790 100644
--- a/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue
+++ b/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue
@@ -20,13 +20,13 @@
- Left Click: Add
+ {{ t("Canvas.LeftClickAdd") }}

-
Right Click: Remove
+
{{ t("Canvas.RightClickRemove") }}
@@ -65,7 +65,7 @@
-->
- 清空当前点位
+ {{ $t("Canvas.TheClearlySelectedContent") }}
@@ -77,6 +77,8 @@
import { ref, onMounted, watch } from "vue";
import { useI18n } from "vue-i18n";
import { OperationType } from "../utils/layerHelper";
+ // 国际化
+ const { t } = useI18n();
const props = defineProps({
canvas: {
type: Object,
@@ -121,32 +123,30 @@
const toolList = [
{
type: OperationType.PART,
- label: "Point Selection",
+ label: t("Canvas.PointSelection"),
icon: "CPoint",
size: "20",
},
{
type: OperationType.PART_RECTANGLE,
- label: "Marquee Selection",
+ label: t("Canvas.MarqueeSelection"),
icon: "CMarquee",
size: "20",
},
{
type: OperationType.PART_BRUSH,
- label: "Brush Selection",
+ label: t("Canvas.BrushSelection"),
icon: "CBrush2",
size: "16",
},
{
type: OperationType.PART_ERASER,
- label: "Erase",
+ label: t("Canvas.Erase"),
icon: "CEraser2",
size: "22",
},
];
- // 国际化
- const { t } = useI18n();
onMounted(() => {});
diff --git a/src/component/Canvas/CanvasEditor/managers/PartManager.js b/src/component/Canvas/CanvasEditor/managers/PartManager.js
index 5b9beb68..8e24630a 100644
--- a/src/component/Canvas/CanvasEditor/managers/PartManager.js
+++ b/src/component/Canvas/CanvasEditor/managers/PartManager.js
@@ -108,6 +108,7 @@ export class PartManager {
}
// 如果从选区工具切换到非选区工具,清理事件和选区
else if (wasActive && !this.isActive) {
+ this.selectionManager.clearSelection();
this.cleanupEvents();
this.clearPartObject();
this.clearPointData();
@@ -618,7 +619,7 @@ export class PartManager {
selectionManager: this.selectionManager,
toolManager: this.toolManager,
})
- this.commandManager.execute(cmd);
+ this.commandManager.execute(cmd)
}
/** 清空点位 */
clearPart() {
diff --git a/src/lang/cn.ts b/src/lang/cn.ts
index 2ec36b83..8410cc4a 100644
--- a/src/lang/cn.ts
+++ b/src/lang/cn.ts
@@ -1503,6 +1503,12 @@ export default {
CompositeLuminosity: '亮度',
CompositeLuminosityTip: '亮度:保留原图像颜色,改变新图像亮度',
GarmentPartSelector: '服装部件选取',
+ LeftClickAdd: '左键添加',
+ RightClickRemove: '右键移除',
+ PointSelection: '点选',
+ MarqueeSelection: '框选',
+ BrushSelection: '画笔',
+ Erase: '擦除',
},
speedList: {
High: '高级',
diff --git a/src/lang/en.ts b/src/lang/en.ts
index ae823e1e..45868772 100644
--- a/src/lang/en.ts
+++ b/src/lang/en.ts
@@ -1554,6 +1554,12 @@ export default {
CompositeLuminosityTip:
'Luminosity: Preserve the original image color and change the luminosity of the new image',
GarmentPartSelector: 'Garment Part Selector',
+ LeftClickAdd: 'Left Click: Add',
+ RightClickRemove: 'Right Click: Remove',
+ PointSelection: 'Point Selection',
+ MarqueeSelection: 'Marquee Selection',
+ BrushSelection: 'Brush Selection',
+ Erase: 'Erase',
},
speedList: {
High: 'High',