Fem: in case the range collapses to a single value expand it to a valid range with +/- eps

This commit is contained in:
wmayer
2022-03-28 20:16:22 +02:00
parent a7ef1d7aa8
commit 5974abe351

View File

@@ -477,6 +477,10 @@ void ViewProviderFemPostObject::WritePointData(vtkPoints* points, vtkDataArray*
void ViewProviderFemPostObject::setRangeOfColorBar(double min, double max)
{
try {
if (min >= max) {
min = max - 10 * std::numeric_limits<float>::epsilon();
max = max + 10 * std::numeric_limits<float>::epsilon();
}
m_colorBar->setRange(min, max);
}
catch (const Base::ValueError& e) {