diff --git a/src/assets/icons/CPart.svg b/src/assets/icons/CPart.svg new file mode 100644 index 00000000..931b5358 --- /dev/null +++ b/src/assets/icons/CPart.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icon/xyz.png b/src/assets/images/icon/xyz.png new file mode 100644 index 00000000..a09a06d8 Binary files /dev/null and b/src/assets/images/icon/xyz.png differ diff --git a/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue b/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue new file mode 100644 index 00000000..18287ea2 --- /dev/null +++ b/src/component/Canvas/CanvasEditor/components/PartSelectorPanel.vue @@ -0,0 +1,855 @@ + + + + + + + + {{ t("Canvas.GarmentPartSelector") }} + + + + + + + {{ $t("Canvas.freehandSketching") }} + + + + {{ $t("Canvas.rectangle") }} + + + + {{ $t("Canvas.ellipse") }} + + + + + + + + + + + {{ $t("Canvas.creation") }} + + + + {{ $t("Canvas.CreateAndCopy") }} + + + + {{ $t("Canvas.TheClearlySelectedContent") }} + + + + + + + + + + + {{ $t("羽化") }} + × + + + + + {{ featherAmount }}px + + + + {{ $t("Canvas.close") }} + + + {{ $t("Canvas.confirmEdit") }} + + + + + + + + + + + {{ $t("Canvas.SelectFillColor") }} + + × + + + + + + + {{ $t("Canvas.close") }} + + + {{ $t("Canvas.confirmEdit") }} + + + + + + + + + + + + diff --git a/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/RepeatSetting.vue b/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/RepeatSetting.vue index dfd96563..e8ad87ca 100644 --- a/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/RepeatSetting.vue +++ b/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/RepeatSetting.vue @@ -1,14 +1,15 @@ + {{ t("Canvas.repeatSetting") }} {{ t("Canvas.angle") }} emit('inputFillAngle', e)" @change="(e) => emit('changeFillAngle', e)" + style-type="2" /> - {{ t("Canvas.scale") }} - Gap X emit('changeFill_Gap', e, gapY)" /> - Gap Y emit('changeFill_Gap', gapX, e)" /> - {{ t("Canvas.offset") }} emit('inputFillOffset', e)" @change="(e) => emit('changeFillOffset', e)" + :show-dish="false" + /> + + + emit('inputFillOffset', e)" + @change="(e) => emit('changeFillOffset', e)" + :show-input="false" /> @@ -88,6 +96,12 @@ }); const gapX = computed(() => props.object.fill_?.gapX || 0); const gapY = computed(() => props.object.fill_?.gapY || 0); + const offsetX = computed( + () => (props.object.fill?.offsetX / props.object.width) * 100 + ); + const offsetY = computed( + () => (props.object.fill?.offsetY / props.object.height) * 100 + ); const emit = defineEmits([ "inputFillAngle", "changeFillAngle", @@ -111,23 +125,36 @@ diff --git a/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/index.vue b/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/index.vue index 83a4ff36..f7ab1ecc 100644 --- a/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/index.vue +++ b/src/component/Canvas/CanvasEditor/components/SelectMenuPanel/index.vue @@ -132,7 +132,6 @@ v-if="v.type === 'rect'" trigger="click" destroyTooltipOnHide - :title="t('Canvas.repeatSetting')" > .list { display: flex; + > div { display: flex; align-items: center; diff --git a/src/component/Canvas/CanvasEditor/components/ToolsSidebar.vue b/src/component/Canvas/CanvasEditor/components/ToolsSidebar.vue index 583a4cf9..b1f29cb0 100644 --- a/src/component/Canvas/CanvasEditor/components/ToolsSidebar.vue +++ b/src/component/Canvas/CanvasEditor/components/ToolsSidebar.vue @@ -166,6 +166,19 @@ const normalToolsList = ref([ icon: { name: "CFont", size: "20" }, class: "text-btn", }, + { + id: OperationType.PART, + title: t("Canvas.GarmentPartSelector"), + action: () => selectTool(OperationType.PART), + icon: { name: "CPart", size: "28" }, + class: "part-btn", + activeList: [ + OperationType.PART, + OperationType.PART_RECTANGLE, + OperationType.PART_BRUSH, + OperationType.PART_ERASER, + ], + }, { id: "help", title: t("Canvas.help"), diff --git a/src/component/Canvas/CanvasEditor/components/tools/AngleTool.vue b/src/component/Canvas/CanvasEditor/components/tools/AngleTool.vue index 5fa56c70..d924525d 100644 --- a/src/component/Canvas/CanvasEditor/components/tools/AngleTool.vue +++ b/src/component/Canvas/CanvasEditor/components/tools/AngleTool.vue @@ -1,32 +1,53 @@ - - - + + + + + - - - - + + + + + + + diff --git a/src/component/Canvas/CanvasEditor/components/tools/OffsetTool.vue b/src/component/Canvas/CanvasEditor/components/tools/OffsetTool.vue index 00288da3..822c05fb 100644 --- a/src/component/Canvas/CanvasEditor/components/tools/OffsetTool.vue +++ b/src/component/Canvas/CanvasEditor/components/tools/OffsetTool.vue @@ -1,84 +1,100 @@ + + + + - + + + X: {{ left }}% + Y: {{ top }}% + + + - - - x:{{ tofix(data.left) }}% y:{{ tofix(data.top) }}%