fix(web): 分析/自动刷新后保留 K 线视窗位置
拆分手动分析与自动刷新拉数路径;全量重建用 logical 优先恢复视窗, 增量 recent 用 scroll+barDelta;避免 barSpacing 重锚与重复冻结导致往右跳。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,12 +12,8 @@ function updateChartDisplay() {
|
||||
_lastKlinePeriod = curPeriod;
|
||||
|
||||
// 保存当前的可见范围(周期切换时不保留,避免范围越界)
|
||||
if (!periodChanged && tvWidget && tvWidget.mainChart) {
|
||||
try {
|
||||
window._pendingRestoreView = captureChartViewState(tvWidget.mainChart);
|
||||
} catch (e) {
|
||||
window._pendingRestoreView = null;
|
||||
}
|
||||
if (!periodChanged && typeof snapshotPendingChartViewport === 'function') {
|
||||
snapshotPendingChartViewport();
|
||||
}
|
||||
|
||||
console.log('更新图表显示');
|
||||
|
||||
Reference in New Issue
Block a user