All files / player-scene-model/src/play-options judge-timing.ts

100% Statements 2/2
75% Branches 3/4
100% Functions 2/2
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10    19x         6x    
/** beatoraja 0.8.9 PlayerConfig.JUDGETIMING_MIN/MAX: integer milliseconds of display-clock adjustment. */
export function clampJudgeTimingMs(value: number): number {
  return Number.isFinite(value) ? Math.max(-500, Math.min(500, Math.round(value))) : 0;
}
 
/** LaneRenderer adds this value to its display clock. Input, audio and judgment clocks remain unchanged. */
export function resolveNoteDisplaySeconds(seconds: number, judgeTimingMs: number): number {
  return seconds + (Number.isFinite(judgeTimingMs) ? Math.trunc(judgeTimingMs) : 0) / 1000;
}