지표추가시 겹침문제

This commit is contained in:
Macbook
2026-05-30 01:06:55 +09:00
parent 09e44008cb
commit ba6695eb9c
2 changed files with 101 additions and 33 deletions
+41
View File
@@ -441,6 +441,11 @@ const TradingChart: React.FC<TradingChartProps> = ({
try {
await mgr.addIndicatorsBatch(missing);
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
requestAnimationFrame(() => requestAnimationFrame(() => {
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
}));
} finally {
indicatorSyncInFlightRef.current = false;
}
@@ -1178,10 +1183,38 @@ const TradingChart: React.FC<TradingChartProps> = ({
indicatorSyncInFlightRef.current = true;
mgr.removeIndicators(removedIds);
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
restoreLogicalRange(mgr, savedLR);
syncIndicatorTrackingRefs(indicators);
indicatorSyncInFlightRef.current = false;
requestAnimationFrame(() => requestAnimationFrame(() => {
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
}));
void repairMissingIndicators(mgr, indicators);
} else if (
addedConfigs.length > 0
&& removedIds.length > 0
&& paramsChangedConfigs.length === 0
) {
/** 지표 교체(제거+추가 동시) — CCI 제거 후 재추가 등 orphan pane·pane index 어긋남 방지 */
const savedLR = mgr.getVisibleLogicalRange();
indicatorSyncInFlightRef.current = true;
mgr.removeIndicators(removedIds);
void mgr.addIndicatorsBatch(addedConfigs).then(() => {
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
restoreLogicalRange(mgr, savedLR);
syncIndicatorTrackingRefs(indicators);
indicatorSyncInFlightRef.current = false;
requestAnimationFrame(() => requestAnimationFrame(() => {
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
[50, 150, 350].forEach(ms => {
setTimeout(() => mgr.notifyPaneLayoutChanged(), ms);
});
}));
});
} else if (
addedConfigs.length > 0
&& removedIds.length === 0
@@ -1191,9 +1224,17 @@ const TradingChart: React.FC<TradingChartProps> = ({
indicatorSyncInFlightRef.current = true;
void mgr.addIndicatorsBatch(addedConfigs).then(() => {
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
restoreLogicalRange(mgr, savedLR);
syncIndicatorTrackingRefs(indicators);
indicatorSyncInFlightRef.current = false;
requestAnimationFrame(() => requestAnimationFrame(() => {
afterIndicatorPaneMutation(mgr);
mgr.notifyPaneLayoutChanged();
[50, 150, 350].forEach(ms => {
setTimeout(() => mgr.notifyPaneLayoutChanged(), ms);
});
}));
});
} else if (
paramsChangedConfigs.length > 0