Merge pull request #85749 from bs-mwoerner/color_picker_quantize_fix
Fix unnecessarily quantizing current color in color picker
This commit is contained in:
commit
1125235c95
|
@ -556,16 +556,17 @@ void ColorPicker::_html_submitted(const String &p_html) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Color previous_color = color;
|
Color new_color = Color::from_string(p_html.strip_edges(), color);
|
||||||
color = Color::from_string(p_html.strip_edges(), previous_color);
|
|
||||||
|
|
||||||
if (!is_editing_alpha()) {
|
if (!is_editing_alpha()) {
|
||||||
color.a = previous_color.a;
|
new_color.a = color.a;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color == previous_color) {
|
if (new_color.to_argb32() == color.to_argb32()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
color = new_color;
|
||||||
|
|
||||||
if (!is_inside_tree()) {
|
if (!is_inside_tree()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue