/** * 치수·지시선·표 스타일 설정 (DIMSTYLE·MLEADERSTYLE·TABLESTYLE·주석 축척). * 기본값은 App.consts의 상수를 그대로 쓰고, 명령이 바꾸면 그 뒤로 반영된다. */ import { ARROW_HEAD_LENGTH, MEASUREMENT_DECIMAL_PLACES, MEASUREMENT_FONT_SIZE, } from '../App.consts'; let dimTextHeight = MEASUREMENT_FONT_SIZE; let dimArrowSize = ARROW_HEAD_LENGTH; let dimDecimals = MEASUREMENT_DECIMAL_PLACES; /** 주석 축척 — 치수·문자·화살표 크기에 곱한다 */ let annotationScale = 1; let tableColumnWidth = 40; let tableRowHeight = 10; export const getDimTextHeight = () => dimTextHeight * annotationScale; export const getDimArrowSize = () => dimArrowSize * annotationScale; export const getDimDecimals = () => dimDecimals; export const getAnnotationScale = () => annotationScale; export const getTableColumnWidth = () => tableColumnWidth; export const getTableRowHeight = () => tableRowHeight; export function setDimStyle(textHeight: number, arrowSize: number, decimals: number): void { if (textHeight > 0) dimTextHeight = textHeight; if (arrowSize > 0) dimArrowSize = arrowSize; if (decimals >= 0) dimDecimals = Math.min(6, Math.round(decimals)); } export function setAnnotationScale(scale: number): void { if (scale > 0) annotationScale = scale; } export function setTableStyle(columnWidth: number, rowHeight: number): void { if (columnWidth > 0) tableColumnWidth = columnWidth; if (rowHeight > 0) tableRowHeight = rowHeight; }