From dfb3cba240f838ec7d937a4b120a97ea0898318e Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sun, 18 Oct 2026 09:42:41 +0900 Subject: [PATCH] =?UTF-8?q?fix(B05=20=EC=A2=85=EB=8B=A8=20=ED=91=9C):=20?= =?UTF-8?q?=EA=B0=92=20=EC=B9=B8=20=EC=84=B8=EC=9B=80=20=ED=8C=90=EC=A0=95?= =?UTF-8?q?=20=3D=20=EA=B8=80=20=ED=8F=AD=20=E2=80=94=20=EC=B9=B8=20?= =?UTF-8?q?=ED=8F=AD=20=EA=B8=B0=EC=A4=80=EC=9D=B4=EB=A9=B4=20=EC=95=88=20?= =?UTF-8?q?=EA=B2=B9=EC=B9=98=EB=8A=94=2016=20m=20=EC=9D=B4=EC=9B=83?= =?UTF-8?q?=EA=B9=8C=EC=A7=80=20=EC=84=B8=EC=9B=8C=EC=A7=90=20(407-5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG --- B05_Profile/B05_Profile_UI_Profile_Table.ts | 29 +++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/B05_Profile/B05_Profile_UI_Profile_Table.ts b/B05_Profile/B05_Profile_UI_Profile_Table.ts index 687d051ea..3dd442f14 100644 --- a/B05_Profile/B05_Profile_UI_Profile_Table.ts +++ b/B05_Profile/B05_Profile_UI_Profile_Table.ts @@ -586,24 +586,37 @@ export function createProfileTable(options: ProfileTableOptions): HTMLElement { table.append( ...buildSegmentRows(alignment, x, fontSize, rowHeight, structureChainages, selectedChainageM), ); - // 이웃 칸과 겹치는 값 칸(1.6 m 이웃 등)은 그 자리에서 세움 — 두께 = 이웃 사이 틈(407-5 · 곡선 행과 같은 규칙) - const stationThickness = crowdedThickness( - alignment.stations.map((station, stationIndex) => - isNearChainage(station.chainage_m, structureChainageList) ? null : centers[stationIndex], + // 이웃 칸과 글이 겹치는 값 칸(1.6 m 이웃 등)만 그 자리에서 세움 — 판정 = 세 행 가운데 가장 긴 글 폭 · + // 두께 = 이웃 사이 틈(407-5 · 곡선 행과 같은 함수) + const stationSpecs = buildStationRows(alignment, stationInterval, display); + const isStructural = alignment.stations.map((station) => + isNearChainage(station.chainage_m, structureChainageList), + ); + const longest = Math.max( + 0, + ...stationSpecs.flatMap((spec) => + alignment.stations.map((_, stationIndex) => + isStructural[stationIndex] ? 0 : spec.cell(stationIndex).length, + ), ), - cellWidth, + ); + const stationThickness = crowdedThickness( + alignment.stations.map((_, stationIndex) => + isStructural[stationIndex] ? null : centers[stationIndex], + ), + longest * fontSize * CHAR_WIDTH_EM + CELL_PADDING_PX * 2, CURVE_ROTATED_WIDTH_PX, ); - buildStationRows(alignment, stationInterval, display).forEach((spec, index) => { + stationSpecs.forEach((spec, index) => { const row = createRow( `${spec.modifier ? `is-${spec.modifier}` : ""}${index === 0 ? " is-group-start" : ""}`, spec.label, spec.unit, ); // 값이 없는 측점(절토고/성토고 중 한쪽)도 빈 칸을 만들어야 세로 구분선이 끊기지 않는다. - alignment.stations.forEach((station, stationIndex) => { + alignment.stations.forEach((_, stationIndex) => { // 구조물 측점 열은 기본값을 비운다 — 격자(빈 셀)만 남기고 값은 선택 오버레이가 맡는다. - const structural = isNearChainage(station.chainage_m, structureChainageList); + const structural = isStructural[stationIndex]; const cell = element( "span", `b05-profile-table__cell${structural ? " is-structure" : ""}`,