From 875fe6cc6d8e769ea18d29880988191d81869e97 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 24 Nov 2010 10:49:59 +0000 Subject: [PATCH] 0020948: EDF 1468 SMESH: Histogram of the quality controls: Small fix: Call SetMaximumNumberOfColors(...) method of the SMESH_ScalarBarActor --- src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx index 547e611d3..b1f9284c6 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx @@ -541,11 +541,17 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply() double oldMinMax[2] = { myLookupTable->GetRange()[0], myLookupTable->GetRange()[1] }; bool rangeChanges = ( fabs( oldMinMax[0] - aMin ) + fabs( oldMinMax[1] - aMax ) > 0.001 * ( aMax-aMin + oldMinMax[1]-oldMinMax[0] )); + + bool nbColorsChanged = (myColorsSpin->value() != myScalarBarActor->GetMaximumNumberOfColors()); + if(nbColorsChanged) + myScalarBarActor->SetMaximumNumberOfColors(myColorsSpin->value()); + + myLookupTable->SetRange( aMin, aMax ); myLookupTable->SetNumberOfTableValues(myColorsSpin->value()); myLookupTable->Build(); - if( myColorsSpin->value() != myScalarBarActor->GetMaximumNumberOfColors() || rangeChanges) + if( nbColorsChanged || rangeChanges) myActor->UpdateDistribution(); SMESH::RepaintCurrentView(); -- 2.39.2