fix: RoutePanel km 방향 확정 — 높은km=위(대전조차장), 낮은km=아래(회덕)

kmToY=(1-ratio), visibleRange/drag seek 모두 동일 방향으로 수정

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
minsung
2026-04-01 16:41:13 +09:00
parent eecd17c590
commit 3f83363ef4

View File

@@ -198,7 +198,7 @@ export default function RoutePanel({ currentTime, visible, onSeek }: RoutePanelP
];
const minK = Math.min(...allKms);
const maxK = Math.max(...allKms);
const targetKm = minK + yPct * (maxK - minK);
const targetKm = maxK - yPct * (maxK - minK);
// Find closest station to target km
let bestStation = validStations[0];
@@ -245,7 +245,7 @@ export default function RoutePanel({ currentTime, visible, onSeek }: RoutePanelP
];
const minKm = Math.min(...allKms);
const maxKm = Math.max(...allKms);
const kmToY = (km: number) => ((km - minKm) / (maxKm - minKm)) * 100;
const kmToY = (km: number) => (1 - (km - minKm) / (maxKm - minKm)) * 100;
// 교량/터널만 표시
const filteredPois = pois.filter(p => p.category === '\uD130\uB110' || p.category === '\uAD50\uB7C9');
@@ -318,8 +318,8 @@ export default function RoutePanel({ currentTime, visible, onSeek }: RoutePanelP
style={{
left: 30,
right: 4,
top: `${kmToY(visibleRange.minKm)}%`,
bottom: `${100 - kmToY(visibleRange.maxKm)}%`,
top: `${kmToY(visibleRange.maxKm)}%`,
bottom: `${100 - kmToY(visibleRange.minKm)}%`,
border: '1px solid rgba(74,222,128,0.7)',
background: 'rgba(74,222,128,0.08)',
}}