summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-09-24 15:43:41 +0200
committerMicky <micheledevita2@gmail.com>2022-09-24 18:15:06 +0200
commit544727ac1ea7616c9f44116360d038cfcda5f763 (patch)
tree81b1cde0358645a9d575a63aed8b603b16e931b6 /scene
parentf74491fdee9bc2d68668137fbacd8f3a7e7e8df7 (diff)
Fix ColorPicker always emitting color_changed on html submit
The color change was always emitted when the the modal was closed, even if it was exactly the same as before.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/color_picker.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 4a1f2ab7c6..5751c54877 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -427,12 +427,15 @@ void ColorPicker::_html_submitted(const String &p_html) {
return;
}
- float last_alpha = color.a;
+ Color previous_color = color;
color = Color::html(p_html);
if (!is_editing_alpha()) {
- color.a = last_alpha;
+ color.a = previous_color.a;
}
+ if (color == previous_color) {
+ return;
+ }
if (!is_inside_tree()) {
return;
}