Skip to content
Snippets Groups Projects
Commit aedd3acf authored by Laurent Stainier's avatar Laurent Stainier
Browse files

Rewind to first non-empty step.

parent ecab3ae4
No related branches found
No related tags found
No related merge requests found
...@@ -371,8 +371,18 @@ static void status_pause_cb(Fl_Widget *w, void *data) ...@@ -371,8 +371,18 @@ static void status_pause_cb(Fl_Widget *w, void *data)
static void status_rewind_cb(Fl_Widget *w, void *data) static void status_rewind_cb(Fl_Widget *w, void *data)
{ {
if(!CTX::instance()->post.animCycle) { if(!CTX::instance()->post.animCycle) {
for(unsigned int i = 0; i < PView::list.size(); i++) for(unsigned int i = 0; i < PView::list.size(); i++) {
opt_view_timestep(i, GMSH_SET | GMSH_GUI, 0); // skip empty steps
int numSteps = (int)opt_view_nb_timestep(i, GMSH_GET, 0);
int step = 0;
while(step < numSteps){
if(PView::list[i]->getData()->hasTimeStep(step))
break;
else
step++;
}
opt_view_timestep(i, GMSH_SET | GMSH_GUI, step);
}
} }
else { else {
view_in_cycle = 0; view_in_cycle = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment