diff options
| author | Juan Linietsky | 2017-06-30 21:30:17 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-06-30 21:35:05 -0300 |
| commit | 2a3e00c8c7e6f997b12864755a3df3b9bd3cca05 (patch) | |
| tree | 807a72e686f76fcf44ecd5fb2e6834545d98b38f /core/variant_op.cpp | |
| parent | e2e73ec906d0671c870ff64eefd15dfc86abaaec (diff) | |
| download | godot-2a3e00c8c7e6f997b12864755a3df3b9bd3cca05.tar.gz godot-2a3e00c8c7e6f997b12864755a3df3b9bd3cca05.tar.zst godot-2a3e00c8c7e6f997b12864755a3df3b9bd3cca05.zip | |
Diffstat (limited to 'core/variant_op.cpp')
| -rw-r--r-- | core/variant_op.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index c4dee5c8a..5fda6b147 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -1109,11 +1109,11 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) const String *str = reinterpret_cast<const String *>(p_index._data._mem); Vector2 *v = reinterpret_cast<Vector2 *>(_data._mem); - if (*str == "x" || *str == "width") { + if (*str == "x") { valid = true; v->x = p_value; return; - } else if (*str == "y" || *str == "height") { + } else if (*str == "y") { valid = true; v->y = p_value; return; @@ -1177,7 +1177,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) valid = true; v->elements[1] = p_value; return; - } else if (*str == "o") { + } else if (*str == "origin") { valid = true; v->elements[2] = p_value; return; @@ -1572,10 +1572,10 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { const String *str = reinterpret_cast<const String *>(p_index._data._mem); const Vector2 *v = reinterpret_cast<const Vector2 *>(_data._mem); - if (*str == "x" || *str == "width") { + if (*str == "x") { valid = true; return v->x; - } else if (*str == "y" || *str == "height") { + } else if (*str == "y") { valid = true; return v->y; } @@ -1657,7 +1657,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { } else if (*str == "y") { valid = true; return v->elements[1]; - } else if (*str == "o") { + } else if (*str == "origin") { valid = true; return v->elements[2]; } @@ -2105,8 +2105,6 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::REAL, "x")); p_list->push_back(PropertyInfo(Variant::REAL, "y")); - p_list->push_back(PropertyInfo(Variant::REAL, "width")); - p_list->push_back(PropertyInfo(Variant::REAL, "height")); } break; // 5 case RECT2: { @@ -2127,7 +2125,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::VECTOR2, "x")); p_list->push_back(PropertyInfo(Variant::VECTOR2, "y")); - p_list->push_back(PropertyInfo(Variant::VECTOR2, "o")); + p_list->push_back(PropertyInfo(Variant::VECTOR2, "origin")); } break; case PLANE: { |
