feat(825-1): B07 내장 캐드 그리드 — 도면 좌표에 붙임 · 1·2·5 적응 간격 · 주선 · 한 칸 크기 표시

- 그리드를 화면 고정 24px 에서 원점 기준 도면 좌표 선으로 바꿈(팬·줌을 따라감 · 보이는 범위만 계산)
- 간격 단계 1·2·5 × 10^k · 보조선 사이 12~30px · 한 방향 선 수 상한 200 · 주선 5·10 × 10^k
- 순수 함수 helpers/grid-steps.ts + 시험 · zoom-out-perf 에 그리드 켠 clear() 선 수 · 시간 시험 추가
- 주선 색 --draw-grid-major 를 공통 테마(밝음 · 어두움)에 더함 · 상태줄에 「그리드 1 칸 = ○ m」 표시

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 18:21:38 +09:00
co-authored by Claude Sonnet 5.5
parent c367ab5f56
commit 2ac6c9808a
7 changed files with 173 additions and 15 deletions
@@ -4,12 +4,14 @@ import {
getAngleStep,
getGridEnabled,
getSnapEnabled,
getScreenCanvasDrawController,
getSnapTrackingEnabled,
setAngleStep,
setGridEnabled,
setSnapEnabled,
setSnapTrackingEnabled,
} from '../state';
import { formatGridStep, pickGridStep } from '../helpers/grid-steps';
interface StatusBarProps {
commandLineVisible: boolean;
@@ -22,7 +24,12 @@ export const StatusBar: FC<StatusBarProps> = ({ commandLineVisible, onToggleComm
const ortho = getAngleStep() === 90;
const polar = getAngleStep() === 45;
const snapTracking = getSnapTrackingEnabled();
// 그리드 한 칸 크기(825-1) — 지금 확대 정도의 보조선 간격
const view = getScreenCanvasDrawController();
const gridStep =
grid && view
? pickGridStep(view.getScreenScale(), Math.max(view.getCanvasSize().x, view.getCanvasSize().y))
: null;
return (
<footer className="cad-statusbar controls">
<button
@@ -85,6 +92,9 @@ export const StatusBar: FC<StatusBarProps> = ({ commandLineVisible, onToggleComm
>
명령행
</button>
{gridStep && (
<span className="cad-statusbar__grid">그리드 1 칸 = {formatGridStep(gridStep.minor)}</span>
)}
<span className="cad-statusbar__hint">휠: 줌 · 휠 드래그: 초점이동 · Esc: 취소</span>
</footer>
);