mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
VizFwk: Discrete log legend: Added missing clamping
This commit is contained in:
parent
f544528aee
commit
33148edef4
@ -72,6 +72,7 @@ Color3ub ScalarMapperDiscreteLog::mapToColor(double scalarValue) const
|
|||||||
double normSemiMaxVal = normalizedValue(levelUnderMax);
|
double normSemiMaxVal = normalizedValue(levelUnderMax);
|
||||||
double adjustedNormVal = 0;
|
double adjustedNormVal = 0;
|
||||||
if (normSemiMaxVal != 0) adjustedNormVal = normDiscVal/normSemiMaxVal;
|
if (normSemiMaxVal != 0) adjustedNormVal = normDiscVal/normSemiMaxVal;
|
||||||
|
adjustedNormVal = cvf::Math::clamp(adjustedNormVal, 0.0, 1.0);
|
||||||
|
|
||||||
return colorFromUserColorGradient(adjustedNormVal);
|
return colorFromUserColorGradient(adjustedNormVal);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user