diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-19 20:43:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-19 20:43:15 +0200 |
commit | 02ed4b392cc6655bfd9958c0c0fececffd8e5836 (patch) | |
tree | c85cc3c0393145911fc714c96635bb5d8eee7124 | |
parent | 922a4f5413f70ed51ba9c433467c5d718af6d117 (diff) | |
parent | 9bdf110840e1b8336bf67f0dda0e92236de258ce (diff) |
Merge pull request #29902 from KoBeWi/dem_setters
Fix set_pick_color error
-rw-r--r-- | scene/gui/color_picker.cpp | 9 | ||||
-rw-r--r-- | scene/gui/color_picker.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index b6abfdd6a8..58a0762469 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -126,7 +126,7 @@ void ColorPicker::_update_controls() { } } -void ColorPicker::set_pick_color(const Color &p_color, bool p_update_sliders) { +void ColorPicker::_set_pick_color(const Color &p_color, bool p_update_sliders) { color = p_color; if (color != last_hsv) { @@ -142,6 +142,11 @@ void ColorPicker::set_pick_color(const Color &p_color, bool p_update_sliders) { _update_color(p_update_sliders); } +void ColorPicker::set_pick_color(const Color &p_color) { + + _set_pick_color(p_color, true); //because setters can't have more arguments +} + void ColorPicker::set_edit_alpha(bool p_show) { edit_alpha = p_show; @@ -175,7 +180,7 @@ void ColorPicker::_value_changed(double) { } } - set_pick_color(color, false); + _set_pick_color(color, false); emit_signal("color_changed", color); } diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 94640be4f0..3af27a9856 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -108,7 +108,8 @@ public: void set_edit_alpha(bool p_show); bool is_editing_alpha() const; - void set_pick_color(const Color &p_color, bool p_update_sliders = true); + void _set_pick_color(const Color &p_color, bool p_update_sliders); + void set_pick_color(const Color &p_color); Color get_pick_color() const; void add_preset(const Color &p_color); |