fix(380-4): 글만 있는 상세 표 위 CAD 과확대 — 맞춤 최소 높이 곁값

- CAD 맞춤(fitView) = 범위를 위 끝에서 아래로 최소 높이까지 늘림 · 부모가 실을 때 fitMinHeight 로 보냄(안 보내면 종전 그대로)
- B06 상세 표 위 CAD = 16(원 마크 아래 끝 ~ 첫 줄 위) — 사토장 등 글만 있는 측점도 배관 측점과 같은 글 크기 · 둘째 줄 안 잘림
- 시험 resources/tester/cad/fit-min-height(종전 3배 넘는 확대 · 같은 배율 · 위 끝 같음 · 큰 범위 그대로)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
2026-10-17 16:07:12 +09:00
co-authored by Claude Opus 5.5
parent e9908f3976
commit 5b993ddded
5 changed files with 66 additions and 1 deletions
@@ -18,9 +18,19 @@ export function fitEntities(): Entity[] {
return structureFrame.length ? structureFrame : pickable.length ? pickable : getEntities();
}
/** 맞춤 최소 높이(월드) — 부모가 도면마다 보냄(`fitMinHeight` · 380-4) · 0 = 없음. */
let fitMinHeight = 0;
/** 실을 때마다 부르는 값 — 수 아니면 0(B07 등 안 보내는 쪽 = 종전 그대로). */
export const setFitMinHeight = (value: unknown): void => {
fitMinHeight = typeof value === 'number' && value > 0 ? value : 0;
};
/** 개체 범위를 화면 가운데에 놓는 배율 · 화면 원점(월드 좌표) */
export function fitView(entities: Entity[], canvasSize: Point): { zoom: number; offset: Point } {
const boundingBox = getBoundingBoxOfMultipleEntities(entities);
const boundingBox = { ...getBoundingBoxOfMultipleEntities(entities) };
// 글 몇 줄뿐인 도면이 칸 높이로 과확대되지 않게 — 범위를 위 끝에서 아래로 최소 높이까지 늘림
boundingBox.minY = Math.min(boundingBox.minY, boundingBox.maxY - fitMinHeight);
const boundingWidth = boundingBox.maxX - boundingBox.minX;
const boundingHeight = boundingBox.maxY - boundingBox.minY;