diff --git a/glade/main-window.glade b/glade/main-window.glade index d4f9732..5ea3f33 100644 --- a/glade/main-window.glade +++ b/glade/main-window.glade @@ -442,7 +442,7 @@ True True - 0 1 0 1 10 10 + 0 0 inf 1 10 10 1 diff --git a/src/gui_builder.cc b/src/gui_builder.cc index 4fe2f57..d598b98 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -90,7 +90,7 @@ GuiBuilder::on_simulation_jump_to_clicked() Gtk::SpinButton* jump_to_spin; _refXml->get_widget("BottomHBox.JumpToSpin", jump_to_spin); int target_instant = jump_to_spin->get_value_as_int(); - assert(target_instant > 0); + assert(target_instant >= 0); Glib::RefPtr jump_to_dialog_glade = Xml::create(GLADEDIR "/jump-to-dialog.glade"); JumpToDialog* jump_to_dialog = NULL; diff --git a/src/jump_to_dialog.cc b/src/jump_to_dialog.cc index 6f111d5..62e7a42 100644 --- a/src/jump_to_dialog.cc +++ b/src/jump_to_dialog.cc @@ -76,7 +76,7 @@ JumpToDialog::start() show(); _progress->set_fraction(0.0); - assert(_target_instant > 0); + assert(_target_instant >= 0); Simulation& sim = Simulation::get_instance(); History& h = sim.get_history(); @@ -171,7 +171,7 @@ JumpToDialog::update(const Simulation& changed_simulation) { const unsigned int front = changed_simulation.get_history().get_front(); - const double percent = std::min(static_cast(front) / _target_instant, 1.0); + const double percent = _target_instant == 0 ? 0 : std::min(static_cast(front) / _target_instant, 1.0); _progress->set_fraction(percent);