From 869ac542425676eabdded25893aabdb2ed5d38d9 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sat, 12 Jun 2021 21:11:45 +0200 Subject: [PATCH] Minor update to the parametric curve fix --- rtengine/diagonalcurves.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc index 8a1c6ccbb..1173f8803 100644 --- a/rtengine/diagonalcurves.cc +++ b/rtengine/diagonalcurves.cc @@ -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); } }