Time: in Frames style a typed number is a frame count (#610 follow-up)
parse_timecode reads bare digits as timecode pairs, so 00100 went to frame 30 (1 s) instead of frame 100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiAJeFttZp83Fh7YuzAR5f
This commit is contained in:
@@ -413,11 +413,7 @@ fn time_set_snaps_to_the_nearest_frame_and_ae_timecode() {
|
||||
#[test]
|
||||
fn time_set_keeps_the_frame_shown_in_the_current_time_field() {
|
||||
let mut s = Session::default();
|
||||
s.execute(
|
||||
"comp.new",
|
||||
json!({"name": "Example", "width": 64, "height": 64, "frameRate": 30, "duration": 0.6, "startTimecode": "0:00:00:05"}),
|
||||
)
|
||||
.unwrap();
|
||||
s.execute("comp.new", json!({"name": "Example", "width": 64, "height": 64, "frameRate": 30, "duration": 0.6, "startTimecode": "0:00:00:05"})).unwrap();
|
||||
let r = s.execute("time.set", json!({"frame": 0})).unwrap();
|
||||
assert_eq!(r["display"], "0:00:00:05");
|
||||
let r = s.execute("time.set", json!({"timecode": "0:00:00:05"})).unwrap();
|
||||
@@ -433,6 +429,17 @@ fn time_set_keeps_the_frame_shown_in_the_current_time_field() {
|
||||
assert_eq!(r["frame"], 13);
|
||||
}
|
||||
|
||||
/// Frames display style: typed digits are a frame count, so 00100 is frame 100, not 1 s (#530).
|
||||
#[test]
|
||||
fn time_set_reads_frames_style_digits_as_a_frame_count() {
|
||||
let mut s = Session::default();
|
||||
s.execute("comp.new", json!({"name": "Long", "width": 64, "height": 64, "frameRate": 30, "duration": 10})).unwrap();
|
||||
s.execute("file.projectSettings", json!({"timeDisplay": "frames"})).unwrap();
|
||||
let r = s.execute("time.set", json!({"timecode": "00100"})).unwrap();
|
||||
assert_eq!(r["frame"], 100);
|
||||
assert_eq!(r["display"], "00100");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn separate_dimensions_split_and_rejoin() {
|
||||
let (mut s, l) = setup();
|
||||
|
||||
Reference in New Issue
Block a user