From bc6174fc9a0d85d6390fcd7390703a1980d71caa Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 1 Oct 2024 14:54:24 -0500 Subject: [PATCH] Ensure SetJson() method recalculates project duration (min/max times) --- src/Timeline.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 7ecb182c..ed07e737 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -812,6 +812,7 @@ void Timeline::calculate_max_duration() { // If no clips or effects exist, set min_time to 0 if (clips.empty() && effects.empty()) { min_time = 0.0; + max_time = 0.0; } } @@ -1302,6 +1303,10 @@ void Timeline::SetJsonValue(const Json::Value root) { preview_width = info.width; preview_height = info.height; + // Resort (and recalculate min/max duration) + sort_clips(); + sort_effects(); + // Re-open if needed if (was_open) Open();