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:
@@ -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;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
setBare,
|
||||
} from '../state.ts';
|
||||
import { setInspectorCollapsed, setRibbonCollapsed } from '../components/ui-state.ts';
|
||||
import { setFitMinHeight } from '../drawControllers/fit-view.ts';
|
||||
import { runCommandInput } from '../commands/run-command.ts';
|
||||
import { setRecoveryScope } from '../helpers/autosave.ts';
|
||||
import { registerBoxResizeDrag } from './box-resize-drag.ts';
|
||||
@@ -73,6 +74,8 @@ interface DrawingLoadMessage {
|
||||
/** 캔버스만 — 제목줄 · 리본 · 패널 · 상태막대를 안 그림(B07 평면도 관리 모달). */
|
||||
bare?: boolean;
|
||||
originMarker?: boolean;
|
||||
/** 맞춤 최소 높이(월드) — 글만 있는 작은 도면 과확대 막음(B06 상세 표 위 CAD · 380-4). */
|
||||
fitMinHeight?: number;
|
||||
/** 작도 영역 가이드 — {area, marks?, editable?} · 없으면 가이드 없음(`guide-area.ts`). */
|
||||
guide?: unknown;
|
||||
}
|
||||
@@ -197,6 +200,7 @@ export function registerAisloDrawingBridge() {
|
||||
runCommandInput('SELECT');
|
||||
// 자동백업을 이 도면 칸으로 옮긴다 — 안 옮기면 백업 한 칸을 서로 덮는다.
|
||||
setRecoveryScope(event.data.recoveryScope ?? event.data.meta?.drawingId ?? null);
|
||||
setFitMinHeight(event.data.fitMinHeight);
|
||||
getScreenCanvasDrawController().zoomToFitScreen();
|
||||
notifyParent(AISLO_DRAWING_LOADED_MESSAGE);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user