Ensure SetJson() method recalculates project duration (min/max times)

This commit is contained in:
Jonathan Thomas
2024-10-01 14:54:24 -05:00
parent 959947a3f8
commit bc6174fc9a

View File

@@ -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();