diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-11-11 13:27:02 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-11 13:27:02 +0700 |
commit | aca18b6a4929554bac5936a83a6e5c5fd0419b8f (patch) | |
tree | 3db9e1a48660bc5c91f6bd1826373435d1910b12 /scene/gui | |
parent | 9bbcc96b706127aef60adfcf08494ac1fde38a00 (diff) | |
parent | 482e07af7e5c8b85463f950036dc7b14cb8cd3b4 (diff) |
Merge pull request #12806 from letheed/unify-degrees
Unify degree methods and properties
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 10 | ||||
-rw-r--r-- | scene/gui/control.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 1f230e95c7..e73ada9f31 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2416,11 +2416,11 @@ float Control::get_rotation() const { return data.rotation; } -void Control::set_rotation_deg(float p_degrees) { +void Control::set_rotation_degrees(float p_degrees) { set_rotation(Math::deg2rad(p_degrees)); } -float Control::get_rotation_deg() const { +float Control::get_rotation_degrees() const { return Math::rad2deg(get_rotation()); } @@ -2596,7 +2596,7 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("set_custom_minimum_size", "size"), &Control::set_custom_minimum_size); ClassDB::bind_method(D_METHOD("set_global_position", "position"), &Control::set_global_position); ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Control::set_rotation); - ClassDB::bind_method(D_METHOD("set_rotation_deg", "degrees"), &Control::set_rotation_deg); + ClassDB::bind_method(D_METHOD("set_rotation_degrees", "degrees"), &Control::set_rotation_degrees); ClassDB::bind_method(D_METHOD("set_scale", "scale"), &Control::set_scale); ClassDB::bind_method(D_METHOD("set_pivot_offset", "pivot_offset"), &Control::set_pivot_offset); ClassDB::bind_method(D_METHOD("get_margin", "margin"), &Control::get_margin); @@ -2605,7 +2605,7 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("get_position"), &Control::get_position); ClassDB::bind_method(D_METHOD("get_size"), &Control::get_size); ClassDB::bind_method(D_METHOD("get_rotation"), &Control::get_rotation); - ClassDB::bind_method(D_METHOD("get_rotation_deg"), &Control::get_rotation_deg); + ClassDB::bind_method(D_METHOD("get_rotation_degrees"), &Control::get_rotation_degrees); ClassDB::bind_method(D_METHOD("get_scale"), &Control::get_scale); ClassDB::bind_method(D_METHOD("get_pivot_offset"), &Control::get_pivot_offset); ClassDB::bind_method(D_METHOD("get_custom_minimum_size"), &Control::get_custom_minimum_size); @@ -2724,7 +2724,7 @@ void Control::_bind_methods() { ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "rect_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_position", "get_position"); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "rect_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_size", "get_size"); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "rect_min_size"), "set_custom_minimum_size", "get_custom_minimum_size"); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "rect_rotation", PROPERTY_HINT_RANGE, "-1080,1080,0.01"), "set_rotation_deg", "get_rotation_deg"); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "rect_rotation", PROPERTY_HINT_RANGE, "-1080,1080,0.01"), "set_rotation_degrees", "get_rotation_degrees"); ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2, "rect_scale"), "set_scale", "get_scale"); ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2, "rect_pivot_offset"), "set_pivot_offset", "get_pivot_offset"); ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "rect_clip_content"), "set_clip_contents", "is_clipping_contents"); diff --git a/scene/gui/control.h b/scene/gui/control.h index 8c1df6784a..4d0e3934ad 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -328,9 +328,9 @@ public: Rect2 get_window_rect() const; ///< use with care, as it blocks waiting for the visual server void set_rotation(float p_radians); - void set_rotation_deg(float p_degrees); + void set_rotation_degrees(float p_degrees); float get_rotation() const; - float get_rotation_deg() const; + float get_rotation_degrees() const; void set_h_grow_direction(GrowDirection p_direction); GrowDirection get_h_grow_direction() const; |