summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-05-01 09:38:50 +0200
committerGitHub <noreply@github.com>2018-05-01 09:38:50 +0200
commit4602e586984d2711a8fb2e53c69e8b333e27a937 (patch)
treecfdef722b356807a403f2ef8c0a3c729a2165f83
parent204de5e6dc143a0fa543d7017919d57e51bdf0f0 (diff)
parent100a775260947757c91e4cfbb968240e1a410927 (diff)
Merge pull request #18355 from ShyRed/fix18344
Keep alpha when changing h, s or v Color property in GDScript
-rw-r--r--core/variant_op.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 4e37593915..621af2dfb7 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -1459,13 +1459,13 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool
v->a = p_value._data._int / 255.0;
valid = true;
} else if (p_index == CoreStringNames::singleton->h) {
- v->set_hsv(p_value._data._int, v->get_s(), v->get_v());
+ v->set_hsv(p_value._data._int, v->get_s(), v->get_v(), v->a);
valid = true;
} else if (p_index == CoreStringNames::singleton->s) {
- v->set_hsv(v->get_h(), p_value._data._int, v->get_v());
+ v->set_hsv(v->get_h(), p_value._data._int, v->get_v(), v->a);
valid = true;
} else if (p_index == CoreStringNames::singleton->v) {
- v->set_hsv(v->get_h(), v->get_v(), p_value._data._int);
+ v->set_hsv(v->get_h(), v->get_v(), p_value._data._int, v->a);
valid = true;
}
} else if (p_value.type == Variant::REAL) {
@@ -1495,13 +1495,13 @@ void Variant::set_named(const StringName &p_index, const Variant &p_value, bool
v->a = p_value._data._real / 255.0;
valid = true;
} else if (p_index == CoreStringNames::singleton->h) {
- v->set_hsv(p_value._data._real, v->get_s(), v->get_v());
+ v->set_hsv(p_value._data._real, v->get_s(), v->get_v(), v->a);
valid = true;
} else if (p_index == CoreStringNames::singleton->s) {
- v->set_hsv(v->get_h(), p_value._data._real, v->get_v());
+ v->set_hsv(v->get_h(), p_value._data._real, v->get_v(), v->a);
valid = true;
} else if (p_index == CoreStringNames::singleton->v) {
- v->set_hsv(v->get_h(), v->get_s(), p_value._data._real);
+ v->set_hsv(v->get_h(), v->get_s(), p_value._data._real, v->a);
valid = true;
}
}
@@ -2117,15 +2117,15 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
return;
} else if (*str == "h") {
valid = true;
- v->set_hsv(p_value, v->get_s(), v->get_v());
+ v->set_hsv(p_value, v->get_s(), v->get_v(), v->a);
return;
} else if (*str == "s") {
valid = true;
- v->set_hsv(v->get_h(), p_value, v->get_v());
+ v->set_hsv(v->get_h(), p_value, v->get_v(), v->a);
return;
} else if (*str == "v") {
valid = true;
- v->set_hsv(v->get_h(), v->get_s(), p_value);
+ v->set_hsv(v->get_h(), v->get_s(), p_value, v->a);
return;
} else if (*str == "r8") {
valid = true;