From 6cba0608c9cde95b819e647cf720da6b2a7b76dc Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Fri, 3 Jun 2011 18:44:01 +0200 Subject: [PATCH] Fixed Auto Levels wrongly turned off, see issue #713 --- rtgui/tonecurve.cc | 17 ++++++++--------- rtgui/tonecurve.h | 6 ++++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 8cd9db8da..9a77d24ce 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -200,14 +200,13 @@ void ToneCurve::setDefaults (const ProcParams* defParams, const ParamsEdited* pe void ToneCurve::curveChanged () { - if (listener) { - listener->panelChanged (EvToneCurve, M("HISTORY_CUSTOMCURVE")); - } + if (listener) listener->panelChanged (EvToneCurve, M("HISTORY_CUSTOMCURVE")); } void ToneCurve::adjusterChanged (Adjuster* a, double newval) { - if (autolevels->get_active() && (a==expcomp || a==black || a==hlcompr || a==hlcomprthresh || a==shcompr)) { + // Switch off auto exposure if user changes sliders manually + if (autolevels->get_active() && (a==expcomp || a==black)) { autolevels->set_active (false); autolevels->set_inconsistent (false); } @@ -312,10 +311,10 @@ int aexpcomputed (void* data) { return 0; } -void ToneCurve::autoExpChanged (double br, int bl) { +void ToneCurve::autoExpChanged (double expcomp, int black) { - nextBl = bl; - nextBr = br; + nextBlack = black; + nextExpcomp = expcomp; g_idle_add (aexpcomputed, this); // Glib::signal_idle().connect (sigc::mem_fun(*this, &ToneCurve::autoExpComputed_)); @@ -339,8 +338,8 @@ bool ToneCurve::autoExpComputed_ () { disableListener (); enableAll (); - expcomp->setValue (nextBr); - black->setValue (nextBl); + expcomp->setValue (nextExpcomp); + black->setValue (nextBlack); if (!blackAdd) shcompr->set_sensitive(!((int)black->getValue ()==0)); //at black=0 shcompr value has no effect enableListener (); diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h index 2b5303f81..b7d88e268 100644 --- a/rtgui/tonecurve.h +++ b/rtgui/tonecurve.h @@ -45,8 +45,10 @@ class ToneCurve : public Gtk::VBox, public AdjusterListener, public FoldableTool sigc::connection autoconn; CurveEditorGroup* curveEditorG; DiagonalCurveEditor* shape; - double nextBr; - int nextBl; + + // used temporarily in eventing + double nextExpcomp; + int nextBlack; public: