This commit is contained in:
2026-07-19 11:36:25 +09:00
parent db817b940a
commit e18753416f
7 changed files with 106 additions and 46 deletions
@@ -10,6 +10,7 @@ import { createWorkflowPanelHandle } from "@ui/ui_template_overlay";
import "../B06_wf3_ProfileCross/B06_wf3_ProfileCross_UI_Style.css";
const COLLAPSED_KEY = "b05-route-profile-collapsed";
const HORIZONTAL_SCROLLBAR_HEIGHT = 16;
function normalizedLongitudinal(data: LongitudinalSection): LongitudinalSection {
return {
@@ -43,11 +44,9 @@ export function createRouteProfilePanel(onSelectStation: (stationId: string) =>
function draw(): void {
if (!detail || body.clientWidth <= 0 || body.clientHeight <= 0) return;
const availableWidth = Math.max(1, body.clientWidth - 30);
const height = body.clientHeight;
const width = Math.max(
availableWidth,
longitudinalMinimumWidth(detail.longitudinal, stationInterval),
);
const height = Math.max(1, body.clientHeight - HORIZONTAL_SCROLLBAR_HEIGHT);
const minimumWidth = longitudinalMinimumWidth(detail.longitudinal, stationInterval);
const width = Math.max(availableWidth, minimumWidth);
lastWidth = body.clientWidth;
lastHeight = height;
body.replaceChildren(
@@ -60,6 +59,7 @@ export function createRouteProfilePanel(onSelectStation: (stationId: string) =>
stationInterval,
width,
height,
minimumWidth,
),
);
}