summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2019-06-19 14:52:54 +0200
committerTomasz Chabora <kobewi4e@gmail.com>2019-06-19 14:52:54 +0200
commit9bdf110840e1b8336bf67f0dda0e92236de258ce (patch)
tree837bfa9a0711f24a8b72cc05af44d8acda0e7dd9
parent66a854da78cae274cf856ff3be65279451c4cb11 (diff)
Fix set_pick_color error
-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);