Honor duration rounding in timeToFrames

Round nonzero duration frame counts away from zero while retaining
absolute-time rounding, default argument selection and numeric coercion.

Cover fractional durations, absolute controls, defaults and coercion.
Sort expected paths in the existing footage test for temporary-directory portability.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
sanyamsingh001
2026-10-14 03:21:23 +10:00
co-authored by Codex
parent 549e9d8251
commit 36ebe2eada
3 changed files with 82 additions and 2 deletions
+3 -1
View File
@@ -261,7 +261,9 @@ function noise(x) {
function timeToFrames(t, fps, isDuration) {
if (t === undefined) t = time + thisComp.displayStartTime;
if (fps === undefined) fps = 1 / __S.fd;
return Math.floor(t * fps + 1e-6);
var frames = t * fps;
if (isDuration && frames !== 0) return frames < 0 ? Math.floor(frames) : Math.ceil(frames);
return Math.floor(frames + 1e-6);
}
function framesToTime(frames, fps) {