summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-24 23:00:19 +0200
committerGitHub <noreply@github.com>2022-09-24 23:00:19 +0200
commit61c0cb712d854881def4f266ca419de8c6fc6f37 (patch)
treefe2b8c7aae8a221079725eaf30cb7d3403710e68
parent39be6695d13dbea1a0d296839b54e34665e3ad02 (diff)
parent544727ac1ea7616c9f44116360d038cfcda5f763 (diff)
Merge pull request #66355 from Mickeon/fix-color-picker-always-color-changed
Fix ColorPicker always emitting color_changed on html submit
-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;
}