Skip to content

Commit

Permalink
Fix bug in render settings dialog
Browse files Browse the repository at this point in the history
The "Unlimited" (rendering time) checkbox was checked even when rendering time was actually limited.
  • Loading branch information
dictoon committed Jan 3, 2020
1 parent ac8a27e commit d50916b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/appleseed.studio/mainwindow/renderingsettingswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,11 @@ namespace
constexpr int DefaultHours = 0;

const int time_limit = m_params_metadata.get_path_optional<int>("progressive_frame_renderer.time_limit.default", -1);
const int hours = time_limit == -1 ? DefaultHours : time_limit / 3600;
const int minutes = time_limit == -1 ? DefaultMinutes : (time_limit - hours * 3600) / 60;
const int seconds = time_limit == -1 ? DefaultSeconds : time_limit - hours * 3600 - minutes * 60;

// Tramsform from seconds.
const unsigned int hours = time_limit == -1 ? DefaultHours : time_limit / 3600;
const unsigned int minutes = time_limit == -1 ? DefaultMinutes : (time_limit - hours * 3600) / 60;
const unsigned int seconds = time_limit == -1 ? DefaultSeconds : time_limit - hours * 3600 - minutes * 60;

set_widget("unlimited_time", true);
set_widget("unlimited_time", time_limit == -1);
set_widget("hours", hours);
set_widget("minutes", minutes);
set_widget("seconds", seconds);
Expand All @@ -553,11 +551,10 @@ namespace
config.get_parameters().remove_path("progressive_frame_renderer.time_limit");
else
{
// Transform to seconds.
const unsigned int hours = get_widget<unsigned int>("hours");
const unsigned int minutes = get_widget<unsigned int>("minutes");
const unsigned int seconds = get_widget<unsigned int>("seconds");
const unsigned int time_limit = seconds + minutes * 60 + hours * 60 * 60;
const int hours = get_widget<int>("hours");
const int minutes = get_widget<int>("minutes");
const int seconds = get_widget<int>("seconds");
const int time_limit = hours * 60 * 60 + minutes * 60 + seconds;
set_config(config, "progressive_frame_renderer.time_limit", time_limit);
}
}
Expand Down

0 comments on commit d50916b

Please sign in to comment.