Refactor interpolation logic in TerritoryLayer for accurate animation timing

- Adjusted the denominator calculation for interpolation to use the actual tick interval, allowing animations to scale correctly with tick speed.
- Removed the previous 250ms cap that caused early animation completion at slower tick speeds, improving visual fidelity during territory transitions.
This commit is contained in:
scamiv
2026-01-13 04:58:53 +01:00
parent 5bd4f70702
commit 423ff61e35
+3 -1
View File
@@ -632,7 +632,9 @@ export class TerritoryLayer implements Layer {
toTime = this.tickTimeMsPrev;
}
const denom = Math.max(1, Math.min(250, toTime - fromTime));
// Use the real tick interval so interpolation duration scales with tick speed.
// The previous 250ms cap caused slow tick speeds (e.g. 0.5x) to finish animations early.
const denom = Math.max(1, toTime - fromTime);
const progress = Math.max(0, Math.min(1, (renderTime - fromTime) / denom));
this.lastInterpolationPair = pair;