From 7f969648b39cc31e31c2144ca7a449523b58fa8c Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Thu, 1 Feb 2018 11:06:34 +0100 Subject: [PATCH] fixed the behaviour of add/set for local contrast during batch edits --- rtgui/paramsedited.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index a13274d67..e31a01898 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1403,18 +1403,19 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten if (localContrast.enabled) { toEdit.localContrast.enabled = mods.localContrast.enabled; } - if (localContrast.radius) { - toEdit.localContrast.radius = mods.localContrast.radius; - } - if (localContrast.amount) { - toEdit.localContrast.amount = mods.localContrast.amount; - } - if (localContrast.darkness) { - toEdit.localContrast.darkness = mods.localContrast.darkness; - } - if (localContrast.lightness) { - toEdit.localContrast.lightness = mods.localContrast.lightness; - } + +#define ADDSETVAL_(v, i) \ + do { \ + if ( v ) { \ + toEdit. v = dontforceSet && options.baBehav[ i ] ? toEdit. v + mods. v : mods. v ; \ + } \ + } while (false) + + ADDSETVAL_(localContrast.radius, ADDSET_LOCALCONTRAST_RADIUS); + ADDSETVAL_(localContrast.amount, ADDSET_LOCALCONTRAST_AMOUNT); + ADDSETVAL_(localContrast.darkness, ADDSET_LOCALCONTRAST_DARKNESS); + ADDSETVAL_(localContrast.lightness, ADDSET_LOCALCONTRAST_LIGHTNESS); +#undef ADDSETVAL_ if (rgbCurves.enabled) { toEdit.rgbCurves.enabled = mods.rgbCurves.enabled;