From 698286ec86fc8f2926ccb60bb7c78c1ae321d5ff Mon Sep 17 00:00:00 2001 From: Nettika Date: Thu, 29 Jan 2026 16:26:27 -0800 Subject: [PATCH] Add translate mode controls --- TODO.md | 12 +- eslint.config.js | 8 + src/App.vue | 3 +- src/components/AppLayout.vue | 4 +- src/components/ContextMenu.vue | 6 +- src/components/Viewport.vue | 188 +++++++++++++-- src/composables/useTranslateGizmo.ts | 327 +++++++++++++++++++++++++++ src/stores/scene.ts | 12 +- src/style.css | 8 +- 9 files changed, 527 insertions(+), 41 deletions(-) create mode 100644 src/composables/useTranslateGizmo.ts diff --git a/TODO.md b/TODO.md index 10c95fe02..d5b89bf89 100644 --- a/TODO.md +++ b/TODO.md @@ -112,12 +112,12 @@ A step-by-step checklist for porting MatterControl's design features to a Vue + ## Phase 5: Transform Tools ### Translate Mode (Default with Selection) -- [ ] Create custom translate gizmo with 3 axis arrows (colored by axis) -- [ ] Attach gizmo to selected object(s) -- [ ] Left-drag handle: free translate along axis -- [ ] Right-drag handle: grid-aligned translate along axis -- [ ] Mouse wheel on handle: change grid granularity -- [ ] Hide gizmo when nothing selected +- [x] Create custom translate gizmo with 3 axis arrows (colored by axis) +- [x] Attach gizmo to selected object(s) +- [x] Left-drag handle: free translate along axis +- [x] Right-drag handle: grid-aligned translate along axis +- [x] Mouse wheel on handle: change grid granularity +- [x] Hide gizmo when nothing selected ### Rotation Mode (Ctrl Modifier) - [ ] Create custom rotation gizmo with flat ring handles per axis diff --git a/eslint.config.js b/eslint.config.js index f107c6e4e..7bf1abe6a 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,6 +8,14 @@ export default tseslint.config( { ignores: ['dist', 'node_modules'] }, js.configs.recommended, ...tseslint.configs.recommended, + { + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, + ], + }, + }, ...pluginVue.configs['flat/recommended'], { languageOptions: { diff --git a/src/App.vue b/src/App.vue index 9a0445119..61183e425 100644 --- a/src/App.vue +++ b/src/App.vue @@ -145,5 +145,4 @@ onUnmounted(() => { - + diff --git a/src/components/AppLayout.vue b/src/components/AppLayout.vue index 29ceefebe..b65efe4db 100644 --- a/src/components/AppLayout.vue +++ b/src/components/AppLayout.vue @@ -7,9 +7,7 @@ const STORAGE_KEY = 'rapidmodel-sidebar-state' const leftCollapsed = ref(false) -const leftSidebarWidth = computed(() => - leftCollapsed.value ? '0' : 'var(--sidebar-width)' -) +const leftSidebarWidth = computed(() => (leftCollapsed.value ? '0' : 'var(--sidebar-width)')) const statusLeftOffset = computed(() => leftCollapsed.value ? 'var(--space-md)' : 'calc(var(--sidebar-width) + var(--space-md))' diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue index 29eb60d1a..4a717bbc2 100644 --- a/src/components/ContextMenu.vue +++ b/src/components/ContextMenu.vue @@ -50,11 +50,7 @@ onUnmounted(() => {