mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-01 14:08:38 -06:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user