Minor update to the parametric curve fix

This commit is contained in:
Thanatomanic 2021-06-12 21:11:45 +02:00 committed by GitHub
parent 3248e6b003
commit 869ac54242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,11 +446,10 @@ double DiagonalCurve::getVal (double t) const
} else {
// add highlights effect:
double htv = xexp(max(mhc * xlog((stretched - mfc) / (1.0 - mfc)),-236.0));
double hbase = pfull_alt (htv, 0.5, x[4]);
//this part of the curve isn't affected by highlight, return the base curve
if (hbase < 1e-6 ){
return stretched;
if (htv < 1e-6) {
return stretched; // this part of the curve isn't affected by highlight, return the base curve
} else {
double hbase = pfull_alt (htv, 0.5, x[4]);
return mfc + (1.0 - mfc) * xexp(xlog(hbase) / mhc);
}
}