summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-06-19 20:43:15 +0200
committerGitHub <noreply@github.com>2019-06-19 20:43:15 +0200
commit02ed4b392cc6655bfd9958c0c0fececffd8e5836 (patch)
treec85cc3c0393145911fc714c96635bb5d8eee7124 /scene
parent922a4f5413f70ed51ba9c433467c5d718af6d117 (diff)
parent9bdf110840e1b8336bf67f0dda0e92236de258ce (diff)
Merge pull request #29902 from KoBeWi/dem_setters
Fix set_pick_color error
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/color_picker.cpp9
-rw-r--r--scene/gui/color_picker.h3
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);