perf(ui): 恢复数字滚动并优化曲线与圆环连续动效

This commit is contained in:
2026-11-04 14:04:05 +08:00
parent f18f6652ff
commit 44f0415ab7
12 changed files with 394 additions and 144 deletions
+14
View File
@@ -32,6 +32,20 @@ import Foundation
if progress == 0 { precondition(abs(left) < 0.000001 && abs(domain.position(old.dates.last!) - 1) < 0.000001) }
if progress == 1 { precondition(abs(right) < 0.000001 && abs(domain.position(next.dates.last!) - 1) < 0.000001) }
}
// The compositor mapping must equal the original interpolated time-domain formula.
for previous in [PanelCurveFrame.Domain(begin: 0, end: 4), .init(begin: 0, end: 118), .init(begin: 2, end: 119.3)] {
for target in [PanelCurveFrame.Domain(begin: 0, end: 6), .init(begin: 2, end: 120), .init(begin: 4.4, end: 121.8)] {
for p in [0.0, 0.25, 0.5, 0.75, 1] {
let map = PanelCurveFrame.horizontalTransform(from: previous, to: target, progress: p, width: 350)
let interpolated = PanelCurveFrame.Domain(begin: previous.begin * (1-p) + target.begin * p,
end: previous.end * (1-p) + target.end * p)
for t in [0.0, 2, 60, 120] {
let date = Date(timeIntervalSinceReferenceDate: t)
precondition(abs(target.position(date) * 350 * map.scale + map.translation - interpolated.position(date) * 350) < 0.00001)
}
}
}
}
print("PASS: timestamp append/full history, pause/reset, missing/nonfinite data, short series, cadence continuity, pause boundaries and 61-point left-edge animation geometry")
}
}