fix: RoutePanel 측점 선형 위아래 반전 수정

kmToY 함수를 반전(1 - ratio)하여 높은 km값이 아래, 낮은 km값이 위에 오도록 수정.
visibleRange 초록 박스 top/bottom도 함께 교정.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
minsung
2026-04-01 16:11:01 +09:00
parent 8ddc148ef9
commit e97c62c445

View File

@@ -223,7 +223,7 @@ export default function RoutePanel({ currentTime, visible, onSeek }: RoutePanelP
]; ];
const minKm = Math.min(...allKms); const minKm = Math.min(...allKms);
const maxKm = Math.max(...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;
return ( return (
<div <div
@@ -289,8 +289,8 @@ export default function RoutePanel({ currentTime, visible, onSeek }: RoutePanelP
style={{ style={{
left: 30, left: 30,
right: 4, right: 4,
top: `${kmToY(visibleRange.minKm)}%`, top: `${kmToY(visibleRange.maxKm)}%`,
bottom: `${100 - kmToY(visibleRange.maxKm)}%`, bottom: `${100 - kmToY(visibleRange.minKm)}%`,
border: '1px solid rgba(74,222,128,0.7)', border: '1px solid rgba(74,222,128,0.7)',
background: 'rgba(74,222,128,0.08)', background: 'rgba(74,222,128,0.08)',
}} }}