diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-03-08 22:10:52 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-03-08 22:54:08 +0000 |
| commit | 65924cfef2131f9773c6a6b28182160522c01954 (patch) | |
| tree | a058c978962a6741292e9da36dbf0e3bbd5abb7c | |
| parent | e77358c6c62130caa336e075bee76c46f1f3983f (diff) | |
Optimise opening of colour conversion editor slightly.
| -rw-r--r-- | src/wx/colour_conversion_editor.cc | 10 | ||||
| -rw-r--r-- | src/wx/colour_conversion_editor.h | 1 |
2 files changed, 11 insertions, 0 deletions
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<wxSpinCtrlDouble*, double> _last_spin_ctrl_value; + bool _ignore_chromaticity_changed; wxSpinCtrlDouble* _input_gamma; wxSpinCtrlDouble* _input_power; |
