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.

(cherry picked from commit 544727ac1e)
This commit is contained in:
Micky 2022-09-24 15:43:41 +02:00 committed by Rémi Verschelde
parent 7284230ebe
commit 2ab79719b2
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -195,12 +195,15 @@ void ColorPicker::_html_entered(const String &p_html) {
return; return;
} }
float last_alpha = color.a; Color previous_color = color;
color = Color::html(p_html); color = Color::html(p_html);
if (!is_editing_alpha()) { if (!is_editing_alpha()) {
color.a = last_alpha; color.a = previous_color.a;
} }
if (color == previous_color) {
return;
}
if (!is_inside_tree()) { if (!is_inside_tree()) {
return; return;
} }