Files
Aislo/B07_DesignDetail/openwebcad/src/components/ViewControls.tsx
T
eomsangdonandClaude Sonnet 5.5 7cb9860500 fix(CAD): 되돌리기 · 다시 하기 한글 자판 대응 · M02 화면 ↶ ↷ 단추(214-1)
- Ctrl+Z · Y · Shift+Z · S · A 를 자판 자리(code)로 판정 — 한글 자판 「ㅋ」·「ㅛ」 · Shift 대문자 대응
- 한글 조합 중에도 Ctrl 단축키는 먹음
- 제목줄 없는 M02 화면(양식 편집 · 구조물 카드)은 우하단 탐색 막대에 되돌리기 · 다시 하기 단추
- 포인터가 CAD 위에 오면 부모 입력 칸이 아닐 때 CAD 로 초점
- 새 시험 resources/tester/cad/ctrl-shortcut-hangul.test.ts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STqEqztUthVFBmEP18wBSz
2026-10-10 15:26:23 +09:00

46 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** 화면 우하단 탐색 막대 (줌 표시·전체 보기) — 제목줄이 없는 화면(M02)은 되돌리기 · 다시 하기도 */
import type { FC } from 'react';
import { runCommandInput } from '../commands/run-command';
import {
getScreenCanvasDrawController,
isDrawingReadOnly,
isHostSave,
isViewOnly,
} from '../state';
export const ViewControls: FC = () => {
const zoom = getScreenCanvasDrawController()?.getScreenScale() ?? 1;
// 제목줄(빠른 막대)이 없는 M02 양식 · 구조물 카드 — 고칠 수 있을 때만
const showUndo = isHostSave() && !isViewOnly() && !isDrawingReadOnly();
return (
<div className="cad-view-controls controls">
{showUndo && (
<>
<button type="button" onClick={() => runCommandInput('UNDO')} title="실행 취소 (Ctrl+Z)">
↶
</button>
<button type="button" onClick={() => runCommandInput('REDO')} title="다시 실행 (Ctrl+Y)">
↷
</button>
</>
)}
<button
type="button"
className="cad-view-controls__fit"
onClick={() => runCommandInput('ZOOM')}
title="범위 줌 (Z) — 도면 전체를 화면에 맞춘다"
>
⛶
</button>
<button type="button" onClick={() => runCommandInput('ZOOMIN')} title="확대">
+
</button>
<span>{Math.round(zoom * 100)}%</span>
<button type="button" onClick={() => runCommandInput('ZOOMOUT')} title="축소">
-
</button>
</div>
);
};