Files
Aislo/B07_DesignDetail/openwebcad/src/components/ViewControls.tsx
T

29 lines
858 B
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.
/** 화면 우하단 탐색 막대 (줌 표시·전체 보기) */
import type { FC } from 'react';
import { runCommandInput } from '../commands/run-command';
import { getScreenCanvasDrawController } from '../state';
export const ViewControls: FC = () => {
const zoom = getScreenCanvasDrawController()?.getScreenScale() ?? 1;
return (
<div className="cad-view-controls controls">
<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>
);
};