From: Simon Rit Date: Mon, 22 Oct 2012 13:27:26 +0000 (+0200) Subject: Fix for Bug #1714: only check on sliders of the visible vvSlicer. X-Git-Tag: v1.4.0~284^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8777ccc7740bb3d319acbb06a03737b3c8209511;p=clitk.git Fix for Bug #1714: only check on sliders of the visible vvSlicer. --- diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index bca77cf..f6f77e2 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -1541,33 +1541,28 @@ void vvMainWindow::InitDisplay() //------------------------------------------------------------------------------ void vvMainWindow::DisplaySliders(int slicer, int window) { + if(!mSlicerManagers[slicer]->GetSlicer(window)->GetRenderer()->GetDraw()) + return; + int range[2]; mSlicerManagers[slicer]->GetSlicer(window)->GetSliceRange(range); int position = mSlicerManagers[slicer]->GetSlicer(window)->GetSlice(); - - int tRange[2]; - tRange[0] = 0; - tRange[1] = mSlicerManagers[slicer]->GetSlicer(window)->GetTMax(); - int tPosition = mSlicerManagers[slicer]->GetSlicer(window)->GetMaxCurrentTSlice(); - bool showHorizontal = false; - bool showVertical = false; if (range[1]>0) - showVertical = true; - if (tRange[1]>0) - showHorizontal = true; - - if (showVertical) verticalSliders[window]->show(); else verticalSliders[window]->hide(); verticalSliders[window]->setRange(range[0],range[1]); verticalSliders[window]->setValue(position); - if (showHorizontal) + int tRange[2]; + tRange[0] = 0; + tRange[1] = mSlicerManagers[slicer]->GetSlicer(window)->GetTMax(); + if (tRange[1]>0) horizontalSliders[window]->show(); else horizontalSliders[window]->hide(); horizontalSliders[window]->setRange(tRange[0],tRange[1]); + int tPosition = mSlicerManagers[slicer]->GetSlicer(window)->GetMaxCurrentTSlice(); horizontalSliders[window]->setValue(tPosition); } //------------------------------------------------------------------------------