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 = () => {