From: Carl Hetherington Date: Tue, 8 Mar 2016 22:10:52 +0000 (+0000) Subject: Optimise opening of colour conversion editor slightly. X-Git-Tag: v2.7.2~2 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=caee7a9456d4abb953d1311333bcdd3454883229;p=dcpomatic.git Optimise opening of colour conversion editor slightly. --- diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc index 36ca074fa..879b16b6f 100644 --- a/src/wx/colour_conversion_editor.cc +++ b/src/wx/colour_conversion_editor.cc @@ -37,6 +37,7 @@ using boost::lexical_cast; ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv) : wxPanel (parent, wxID_ANY) + , _ignore_chromaticity_changed (false) { wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); SetSizer (overall_sizer); @@ -245,6 +246,8 @@ ColourConversionEditor::set (ColourConversion conversion) _yuv_to_rgb->SetSelection (conversion.yuv_to_rgb ()); + _ignore_chromaticity_changed = true; + SafeStringStream s; s.setf (std::ios::fixed, std::ios::floatfield); s.precision (6); @@ -280,6 +283,8 @@ ColourConversionEditor::set (ColourConversion conversion) s << conversion.white().y; _white_y->SetValue (std_to_wx (s.str ())); + _ignore_chromaticity_changed = false; + if (conversion.adjusted_white ()) { _adjust_white->SetValue (true); s.str (""); @@ -294,6 +299,7 @@ ColourConversionEditor::set (ColourConversion conversion) update_rgb_to_xyz (); update_bradford (); + changed (); } ColourConversion @@ -365,6 +371,10 @@ ColourConversionEditor::changed () void ColourConversionEditor::chromaticity_changed () { + if (_ignore_chromaticity_changed) { + return; + } + update_rgb_to_xyz (); changed (); } diff --git a/src/wx/colour_conversion_editor.h b/src/wx/colour_conversion_editor.h index 918f2a7d0..f1186aa2a 100644 --- a/src/wx/colour_conversion_editor.h +++ b/src/wx/colour_conversion_editor.h @@ -49,6 +49,7 @@ private: void set_spin_ctrl (wxSpinCtrlDouble *, double); std::map _last_spin_ctrl_value; + bool _ignore_chromaticity_changed; wxSpinCtrlDouble* _input_gamma; wxSpinCtrlDouble* _input_power;