Merge pull request #66355 from Mickeon/fix-color-picker-always-color-changed

Fix ColorPicker always emitting color_changed on html submit
This commit is contained in:
Rémi Verschelde 2022-09-24 23:00:19 +02:00 committed by GitHub
commit 61c0cb712d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}