전략평가 화면 수정
This commit is contained in:
@@ -69,18 +69,16 @@ function indexFromClientX(
|
||||
return findNearestBarIndex(bars, time);
|
||||
}
|
||||
|
||||
/** 캔들 pane 클릭 좌표 → 봉 index (전략선택봉 이동) */
|
||||
/** 차트 클릭 좌표 → 봉 index (전략선택봉 이동, 전략선택봉 영역 제외는 호출측) */
|
||||
export function resolveBarIndexAtChartClick(
|
||||
manager: ChartManager,
|
||||
bars: OHLCVBar[],
|
||||
clientX: number,
|
||||
clientY: number,
|
||||
): number {
|
||||
const rect = manager.getContainer().getBoundingClientRect();
|
||||
const clickY = clientY - rect.top;
|
||||
const main = manager.getPaneLayouts().find(l => l.paneIndex === 0);
|
||||
if (!main || clickY < main.topY || clickY >= main.topY + main.height) return -1;
|
||||
return indexFromClientX(manager, bars, clientX);
|
||||
const idx = manager.resolveNearestBarIndexAtClientPoint(clientX, clientY);
|
||||
if (idx < 0 || idx >= bars.length) return -1;
|
||||
return idx;
|
||||
}
|
||||
|
||||
const StrategyEvaluationBarSelector: React.FC<Props> = ({
|
||||
|
||||
Reference in New Issue
Block a user