- Let the user jump to instant 0
- Fix adjustment for jumpto in the XML file by hand, since glade3 has a nasty bug about spinbox values git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1226 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
76b33d4269
commit
449d1cadad
3 changed files with 4 additions and 4 deletions
|
@ -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<double>(front) / _target_instant, 1.0);
|
||||
const double percent = _target_instant == 0 ? 0 : std::min(static_cast<double>(front) / _target_instant, 1.0);
|
||||
|
||||
_progress->set_fraction(percent);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue