From ad4df402b0790570c748f4b841871ffa60c5dd28 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 4 Mar 2010 22:44:02 +0000 Subject: [PATCH] better fix, but not perfect yet --- Fltk/graphicWindow.cpp | 4 +++- Post/PViewDataGModel.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index a2642fb3df..867ebbae9b 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -235,11 +235,13 @@ void status_play_manual(int time, int step) // skip any empty steps (useful when merging only some steps) int newStep = (int)opt_view_timestep(i, GMSH_GET, 0) + step; int totalSteps = (int)opt_view_nb_timestep(i, GMSH_GET, 0); - while(newStep < totalSteps){ + for(int j = 0; j < totalSteps; j++){ if(PView::list[i]->getData()->hasTimeStep(newStep)) break; else newStep += step; + if(newStep < 0) newStep = totalSteps - 1; + if(newStep > totalSteps - 1) newStep = 0; } opt_view_timestep(i, GMSH_SET | GMSH_GUI, newStep); } diff --git a/Post/PViewDataGModel.cpp b/Post/PViewDataGModel.cpp index e39342e480..d915edf87e 100644 --- a/Post/PViewDataGModel.cpp +++ b/Post/PViewDataGModel.cpp @@ -489,7 +489,8 @@ bool PViewDataGModel::skipElement(int step, int ent, int ele, bool checkVisibili bool PViewDataGModel::hasTimeStep(int step) { - if(step < getNumTimeSteps() && _steps[step]->getNumData()) return true; + if(step >= 0 && step < getNumTimeSteps() && _steps[step]->getNumData()) + return true; return false; } -- GitLab