From db8462c6d4293f60b30e2ed9363de9eee02a7661 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 15 Oct 2026 23:41:46 +0900 Subject: [PATCH] =?UTF-8?q?feat(B07=20CAD):=20337-2=20=EB=A7=88-1=20?= =?UTF-8?q?=EC=98=A4=ED=86=A0=EC=BA=90=EB=93=9C=20=EB=A7=88=EC=9A=B0?= =?UTF-8?q?=EC=8A=A4=20=E2=80=94=20=EB=88=84=EB=A6=84=20=EB=8D=94=ED=95=A8?= =?UTF-8?q?=20=C2=B7=20Shift=20=EB=BA=8C=20=C2=B7=20=EC=83=81=EC=9E=90=20?= =?UTF-8?q?=EB=8D=94=ED=95=A8/=EB=BA=8C=20=C2=B7=20=EB=AA=85=EB=A0=B9=20?= =?UTF-8?q?=EC=A4=91=20=EB=81=8C=EA=B8=B0=20=EC=83=81=EC=9E=90=20=C2=B7=20?= =?UTF-8?q?=EC=8A=A4=EC=B9=A8=20=C2=B7=20=EA=B7=B8=EB=A6=BD=20=EB=88=84?= =?UTF-8?q?=EB=A5=B4=EA=B3=A0-=EC=98=AE=EA=B8=B0=EA=B3=A0-=EB=88=84?= =?UTF-8?q?=EB=A5=B4=EA=B8=B0=20=C2=B7=20=EA=B7=B8=EB=A6=BD=20=EC=88=AB?= =?UTF-8?q?=EC=9E=90=20=C2=B7=20=EB=B3=B4=EA=B8=B0=20=EC=A0=84=EC=9A=A9=20?= =?UTF-8?q?=EB=AC=B8=20=C2=B7=20=EC=A7=81=EA=B5=90=20=EA=B0=95=EC=A0=9C=20?= =?UTF-8?q?=C2=B7=20Shift=20=EC=9E=84=EC=8B=9C=20=EC=A7=81=EA=B5=90=20?= =?UTF-8?q?=C2=B7=20=ED=9C=A0=20=EA=B8=B0=EB=B3=B8=20=EB=B0=82=20=C2=B7=20?= =?UTF-8?q?=ED=9C=A0=20=EB=91=90=20=EB=B2=88=20=EB=B2=94=EC=9C=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 고르기: 누름 = 더함 · Shift = 뺌 · Ctrl = 넣고 빼기 · 상자 = 앞 고름 ∪ 상자 · Shift 상자 = 뺌(H4 · H5) · 명령 안 고르기 단계도 누를 때 첫 점 · 스침 강조(ic/selecting.ts) - 그립: 쉴 때만 집음(N7) · 누르고 떼면 대기 → 다음 누름에 놓음 · 끌어 놓기(H3) · 거리 숫자(N8) · 확정 · 읽기 전용 도면은 그립 · Delete 막음(H2) - 직교: F8 = 기준점에서 가로 · 세로 강제 · Shift 누른 동안 뒤집음 · 객체 스냅 점 · 좌표 · 각도 잠금은 안 덮음 · 클릭 사건 snapped 채움(ic/ortho.ts · H8) · 가이드는 F3 와 뗌 · 가이드 잡는 거리 = 화면 픽셀(H9) - 휠: 기본 밂(앞으로 굴리면 확대 · 오토캐드 · 모든 화면 · ☰ 설정 뒤집기 그대로) · 가운데 단추 두 번 = 범위 줌 · ZOOM · ⛶ 앞 화면 기억(ic/zoom-prompt.ts) - 시험: mouse-acad 새로 · 휠 방향 시험 손질(input-wheel · input-prefs-cad · input_prefs · app_settings · 164 · 220_1 · 221_1 · 244_8 기대값 뒤집음 · 266 pull 박음) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf --- A00_Common/input_prefs.ts | 8 +- .../openwebcad/src/commands/commands.view.ts | 3 +- .../src/components/ViewControls.tsx | 3 +- .../calculate-angle-guides-and-snap-points.ts | 35 +- .../openwebcad/src/helpers/draw.ts | 4 +- .../openwebcad/src/helpers/get-draw-guides.ts | 6 +- .../src/helpers/get-point-from-event.ts | 27 +- .../src/inputController/input-controller.ts | 69 ++-- .../src/inputController/input-wheel.test.ts | 7 +- .../src/inputController/input-wheel.ts | 2 +- .../openwebcad/src/inputController/ortho.ts | 45 +++ .../src/inputController/selecting.ts | 26 ++ .../src/inputController/zoom-prompt.ts | 48 +++ .../openwebcad/src/tools/grip-edit-tool.ts | 10 +- .../src/tools/select-tool.helpers.ts | 109 +++---- .../openwebcad/src/tools/select-tool.ts | 7 +- resources/tester/cad/input-prefs-cad.test.ts | 22 +- resources/tester/cad/mouse-acad.test.ts | 308 ++++++++++++++++++ resources/tester/helper_164_detail_zoom.cjs | 10 +- resources/tester/helper_218_1_loupe.cjs | 30 +- resources/tester/helper_266_detail_home.cjs | 6 +- resources/tester/helper_input_prefs.cjs | 4 +- resources/tester/test_164_detail_zoom.py | 2 +- resources/tester/test_220_1_loupe_wheel.py | 6 +- .../test_244_8_b08_milestone_no_scroll.py | 8 +- resources/tester/test_app_settings.py | 27 +- resources/tester/test_input_prefs.py | 21 +- 27 files changed, 655 insertions(+), 198 deletions(-) create mode 100644 B07_DesignDetail/openwebcad/src/inputController/ortho.ts create mode 100644 B07_DesignDetail/openwebcad/src/inputController/selecting.ts create mode 100644 B07_DesignDetail/openwebcad/src/inputController/zoom-prompt.ts create mode 100644 resources/tester/cad/mouse-acad.test.ts diff --git a/A00_Common/input_prefs.ts b/A00_Common/input_prefs.ts index 49fff86db..a13c87f7c 100644 --- a/A00_Common/input_prefs.ts +++ b/A00_Common/input_prefs.ts @@ -4,7 +4,7 @@ * * - 값 = `aislo:pref:input-prefs`(등록표 `input-prefs`) JSON 한 벌 · 부를 때마다 읽음(새로고침 없이 바로 따름) * - 없음 · 깨짐 · Node(저장소 없음) = 기본값(= 지금 동작) · 의존 없음 · 불러올 때 window 안 만짐(CAD 도 import) - * - 휠 확대 방향 하나로 모든 화면 일체 — 당김 = 휠을 몸 쪽으로(deltaY > 0) 굴리면 확대 + * - 휠 확대 방향 하나로 모든 화면 일체 — 기본 밂 = 휠을 앞으로(deltaY < 0) 굴리면 확대(오토캐드) · 당김 = 몸 쪽으로 * - 핀치(트랙패드 · 손가락)는 설정과 상관없이 늘 벌리면 확대(deltaY < 0) * ========================================================================== */ @@ -20,7 +20,7 @@ export interface InputPrefs { /** `stateKey("input-prefs")` 와 같은 키(시험이 맞춰 봄) — 등록표를 불러오면 window 가 딸려 와서 글자로 둠 */ export const INPUT_PREFS_KEY = "aislo:pref:input-prefs"; -export const DEFAULT_INPUT_PREFS: InputPrefs = { wheelZoom: "pull", cadAliases: {} }; +export const DEFAULT_INPUT_PREFS: InputPrefs = { wheelZoom: "push", cadAliases: {} }; const cleanAliases = (raw: unknown): Record => { const out: Record = {}; @@ -42,7 +42,7 @@ export function inputPrefs(): InputPrefs { if (!raw) return { ...DEFAULT_INPUT_PREFS, cadAliases: {} }; const value = JSON.parse(raw) as Partial | null; return { - wheelZoom: value?.wheelZoom === "push" ? "push" : "pull", + wheelZoom: value?.wheelZoom === "pull" ? "pull" : "push", cadAliases: cleanAliases(value?.cadAliases), }; } catch { @@ -52,7 +52,7 @@ export function inputPrefs(): InputPrefs { /** 휠 한 번이 확대인가 — 설정 방향을 따름 */ export const wheelIn = (deltaY: number): boolean => - inputPrefs().wheelZoom === "push" ? deltaY < 0 : deltaY > 0; + inputPrefs().wheelZoom === "pull" ? deltaY > 0 : deltaY < 0; /** 트랙패드 핀치 — 브라우저가 Ctrl+휠 · 잘게 쪼갠 값으로 냄 * ponytail: |deltaY| < 50 로 마우스 Ctrl+휠(한 칸 ≥ 약 100)과 가름 · 잘게 도는 마우스는 핀치로 봄 */ diff --git a/B07_DesignDetail/openwebcad/src/commands/commands.view.ts b/B07_DesignDetail/openwebcad/src/commands/commands.view.ts index 0c21cedee..006dfb571 100644 --- a/B07_DesignDetail/openwebcad/src/commands/commands.view.ts +++ b/B07_DesignDetail/openwebcad/src/commands/commands.view.ts @@ -6,6 +6,7 @@ import { bumpSceneVersion } from '../helpers/scene-version'; import { getScreenCanvasDrawController, setEntities, getEntities } from '../state'; import { Tool } from '../tools'; import { selectToolStateMachine } from '../tools/select-tool'; +import { zoomExtents } from '../inputController/zoom-prompt'; const zoomBy = (factor: number): string => { const controller = getScreenCanvasDrawController(); @@ -45,7 +46,7 @@ export const VIEW_COMMANDS: CadCommand[] = [ glyph: '⛶', hint: '도면 전체가 보이도록 화면을 맞춘다', run: () => { - getScreenCanvasDrawController().zoomToFitScreen(); + zoomExtents(); // 앞 화면 기억(이전(P)) return '도면 전체 보기'; }, }, diff --git a/B07_DesignDetail/openwebcad/src/components/ViewControls.tsx b/B07_DesignDetail/openwebcad/src/components/ViewControls.tsx index c5c16e0c2..75d0baa20 100644 --- a/B07_DesignDetail/openwebcad/src/components/ViewControls.tsx +++ b/B07_DesignDetail/openwebcad/src/components/ViewControls.tsx @@ -1,6 +1,7 @@ /** 화면 우하단 탐색 막대 (줌 표시·전체 보기) — 제목줄이 없는 화면(M02)은 되돌리기 · 다시 하기도 */ import type { FC } from 'react'; import { runCommandInput } from '../commands/run-command'; +import { zoomExtents } from '../inputController/zoom-prompt'; import { getScreenCanvasDrawController, isDrawingReadOnly, @@ -28,7 +29,7 @@ export const ViewControls: FC = () => {