From 51be0a314144fba090d3471ffb35de8c0f52ec6d Mon Sep 17 00:00:00 2001
From: Ulrich Kemloh <kemlohulrich@gmail.com>
Date: Mon, 28 Sep 2015 10:50:40 +0200
Subject: [PATCH] fixed error displaying the number of frames when manually
 using the slider

---
 src/MainWindow.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index f725d71..70c0804 100755
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -869,18 +869,18 @@ void MainWindow::slotCurrentAction(QString msg)
 
 void MainWindow::slotFrameNumber(unsigned long actualFrameCount)
 {
-    QString msg;
-    msg.setNum(actualFrameCount);
-
-    ui.frameSliderLabel->setText("Frame: " + msg);
 
     //compute the  mamixum framenumber
     int maxFrameCount=1;
     if(extern_first_dataset_loaded) {
         maxFrameCount=extern_trajectories_firstSet.getFramesNumber();
-
     }
 
+    if(actualFrameCount>maxFrameCount) actualFrameCount=maxFrameCount;
+    QString msg;
+    msg.setNum(actualFrameCount);
+    ui.frameSliderLabel->setText("Frame: " + msg);
+
     if(!frameSliderHold)if(maxFrameCount!=0)//TODO WTF, otherwise an arrymtic exeption arises
         ui.framesIndicatorSlider->setValue((ui.framesIndicatorSlider->maximum()*actualFrameCount)/maxFrameCount);
 }
-- 
GitLab