From dc5d932b1156ba83d8aee29676e1d642825d1d8d Mon Sep 17 00:00:00 2001 From: lzp Date: Mon, 16 Mar 2026 16:51:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=B1=E5=BA=A6=E7=94=BB=E5=B8=83-?= =?UTF-8?q?=E5=B9=B3=E9=93=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/depth-header-tools.vue | 9 +- .../components/details-panel/fill-repeat.vue | 184 ++++++++++++++++ .../components/details-panel/index.vue | 26 ++- .../components/tools/depth-input.vue | 17 +- .../components/tools/depth-offset-tool.vue | 24 ++- .../Canvas/DepthCanvas/depth-canvas.vue | 54 +++-- .../DepthCanvas/manager/CanvasManager.ts | 13 +- .../DepthCanvas/manager/LayerManager.ts | 11 +- .../DepthCanvas/manager/ObjectManager.ts | 196 ++++++++++++++++++ .../DepthCanvas/manager/StateManager.ts | 28 ++- .../manager/brushes/BrushRegistry.js | 2 +- .../manager/events/CanvasEventManager.js | 14 +- .../manager/events/KeyEventManager.ts | 1 + .../FlowCanvas/components/tools/my-input.vue | 17 +- .../components/tools/offset-tool.vue | 2 +- 15 files changed, 539 insertions(+), 59 deletions(-) create mode 100644 src/components/Canvas/DepthCanvas/components/details-panel/fill-repeat.vue create mode 100644 src/components/Canvas/DepthCanvas/manager/ObjectManager.ts diff --git a/src/components/Canvas/DepthCanvas/components/depth-header-tools.vue b/src/components/Canvas/DepthCanvas/components/depth-header-tools.vue index d153721..637918d 100644 --- a/src/components/Canvas/DepthCanvas/components/depth-header-tools.vue +++ b/src/components/Canvas/DepthCanvas/components/depth-header-tools.vue @@ -36,9 +36,10 @@ step: { default: 0.1, type: Number } }) const emit = defineEmits(['export', 'export-local', 'import-local', 'export-close']) - const importLocalImage = inject('importLocalImage') as () => void + const importLocalImage = inject('importLocalImage') as (isRecord?: boolean) => void const stateManager = inject('stateManager') as any const toolManager = inject('toolManager') as any + const objectManager = inject('objectManager') as any const tool = computed(() => toolManager.currentTool.value) const historyIndex = computed(() => stateManager.historyIndex.value) const historyList = computed(() => stateManager.historyList.value) @@ -54,7 +55,7 @@ icon: 'dc-image', iconSize: 17, disabled: ref(false), - on: () => importLocalImage() + on: () => onImageClick() }, { name: OperationType.SELECTBOX, icon: 'dc-selectbox', iconSize: 16, disabled: ref(false) }, { name: OperationType.RECTANGLE, icon: 'dc-rectangle', iconSize: 16, disabled: ref(false) }, @@ -82,6 +83,10 @@ toolManager.setTool(tool.name) } } + const onImageClick = async () => { + const layer = await importLocalImage(false) + objectManager.setFillRepeat(layer?.info?.id) + } diff --git a/src/components/Canvas/DepthCanvas/components/details-panel/index.vue b/src/components/Canvas/DepthCanvas/components/details-panel/index.vue index 5e0320c..53036d1 100644 --- a/src/components/Canvas/DepthCanvas/components/details-panel/index.vue +++ b/src/components/Canvas/DepthCanvas/components/details-panel/index.vue @@ -7,14 +7,16 @@ -
- +
+ +