Files
Aislo/B05_Profile/logic/B05_Profile_RouteEdit_InfoLift.ts
T
eomsangdonandClaude Opus 5.5 c860193090 fix(B05 노선 편집 상태줄): 종단 판 열림 때 상태 · 범례를 판 위로 올림 (408-2)
- 판이 지도 아래를 덮은 높이 = logic InfoLift infoLiftPx · Chrome 이 판 크기 관찰로 --b05-profile-cover 적음
- 접힘 · 창 분할 = 제자리 · 판을 끝까지 올려도 지도 안 120 px 남김
- 시험 test_408_2_status_lift 새로 · test_345_5c 자리 규칙 고쳐 씀

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
2026-10-18 09:23:48 +09:00

20 lines
1005 B
TypeScript

/* =============================================================================
* B05_Profile/logic/B05_Profile_RouteEdit_InfoLift.ts
* 평면 상태 · 범례 올림(408-2) — 뜬 종단 판이 지도 아래를 덮은 높이만큼 위로.
* 파이썬 짝 아님. 순수 계산 — 화면 · fetch · sessionStorage 없음. 부르는 쪽은 `_UI_RouteEdit_Chrome`.
* ========================================================================== */
/** 상태 글판이 이 높이(px)는 지도 위에 남게 — 판을 끝까지 올려도 지도 밖으로 안 나감. */
const KEEP_PX = 120;
/** 올릴 높이(px) — `profileTop` = 종단 판 윗변(없음 · 접힘 · 창 분할 = null) · 지도 칸 아래 · 높이. */
export function infoLiftPx(
mapBottom: number,
mapHeight: number,
profileTop: number | null,
): number {
if (profileTop === null) return 0;
const cover = Math.max(0, mapBottom - profileTop);
return Math.round(Math.min(cover, Math.max(0, mapHeight - KEEP_PX)));
}