mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
Remove deprecated rotation methods
This commit is contained in:
parent
2e89dd19b1
commit
ab2647a0d0
@ -155,14 +155,6 @@ void Node2D::set_rotation_in_degrees(float p_degrees) {
|
||||
set_rotation(Math::deg2rad(p_degrees));
|
||||
}
|
||||
|
||||
// Kept for compatibility after rename to set_rotd.
|
||||
// Could be removed after a couple releases.
|
||||
void Node2D::_set_rotd(float p_degrees) {
|
||||
|
||||
WARN_PRINT("Deprecated method Node2D._set_rotd(): This method was renamed to set_rotd. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
set_rotation_in_degrees(p_degrees);
|
||||
}
|
||||
|
||||
void Node2D::set_scale(const Size2 &p_scale) {
|
||||
|
||||
if (_xform_dirty)
|
||||
@ -182,23 +174,19 @@ Point2 Node2D::get_position() const {
|
||||
((Node2D *)this)->_update_xform_values();
|
||||
return pos;
|
||||
}
|
||||
|
||||
float Node2D::get_rotation() const {
|
||||
if (_xform_dirty)
|
||||
((Node2D *)this)->_update_xform_values();
|
||||
|
||||
return angle;
|
||||
}
|
||||
|
||||
float Node2D::get_rotation_in_degrees() const {
|
||||
|
||||
return Math::rad2deg(get_rotation());
|
||||
}
|
||||
// Kept for compatibility after rename to get_rotd.
|
||||
// Could be removed after a couple releases.
|
||||
float Node2D::_get_rotd() const {
|
||||
|
||||
WARN_PRINT("Deprecated method Node2D._get_rotd(): This method was renamed to get_rotd. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
return get_rotation_in_degrees();
|
||||
}
|
||||
Size2 Node2D::get_scale() const {
|
||||
if (_xform_dirty)
|
||||
((Node2D *)this)->_update_xform_values();
|
||||
@ -410,10 +398,6 @@ Point2 Node2D::to_global(Point2 p_local) const {
|
||||
|
||||
void Node2D::_bind_methods() {
|
||||
|
||||
// TODO: Obsolete those two methods (old name) properly (GH-4397)
|
||||
ClassDB::bind_method(D_METHOD("_get_rotd"), &Node2D::_get_rotd);
|
||||
ClassDB::bind_method(D_METHOD("_set_rotd", "degrees"), &Node2D::_set_rotd);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_position", "position"), &Node2D::set_position);
|
||||
ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Node2D::set_rotation);
|
||||
ClassDB::bind_method(D_METHOD("set_rotation_in_degrees", "degrees"), &Node2D::set_rotation_in_degrees);
|
||||
|
@ -48,10 +48,6 @@ class Node2D : public CanvasItem {
|
||||
|
||||
void _update_transform();
|
||||
|
||||
// Deprecated, should be removed in a future version.
|
||||
void _set_rotd(float p_degrees);
|
||||
float _get_rotd() const;
|
||||
|
||||
void _update_xform_values();
|
||||
|
||||
protected:
|
||||
|
@ -332,12 +332,6 @@ void Spatial::set_rotation_in_degrees(const Vector3 &p_euler_deg) {
|
||||
set_rotation(p_euler_deg * Math_PI / 180.0);
|
||||
}
|
||||
|
||||
void Spatial::_set_rotation_deg(const Vector3 &p_euler_deg) {
|
||||
|
||||
WARN_PRINT("Deprecated method Spatial._set_rotation_deg(): This method was renamed to set_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
set_rotation_in_degrees(p_euler_deg);
|
||||
}
|
||||
|
||||
void Spatial::set_scale(const Vector3 &p_scale) {
|
||||
|
||||
if (data.dirty & DIRTY_VECTORS) {
|
||||
@ -375,14 +369,6 @@ Vector3 Spatial::get_rotation_in_degrees() const {
|
||||
return get_rotation() * 180.0 / Math_PI;
|
||||
}
|
||||
|
||||
// Kept for compatibility after rename to set_rotd.
|
||||
// Could be removed after a couple releases.
|
||||
Vector3 Spatial::_get_rotation_deg() const {
|
||||
|
||||
WARN_PRINT("Deprecated method Spatial._get_rotation_deg(): This method was renamed to get_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
return get_rotation_in_degrees();
|
||||
}
|
||||
|
||||
Vector3 Spatial::get_scale() const {
|
||||
|
||||
if (data.dirty & DIRTY_VECTORS) {
|
||||
@ -705,10 +691,6 @@ void Spatial::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel);
|
||||
ClassDB::bind_method(D_METHOD("get_world"), &Spatial::get_world);
|
||||
|
||||
// TODO: Obsolete those two methods (old name) properly (GH-4397)
|
||||
ClassDB::bind_method(D_METHOD("_set_rotation_deg", "rotation_deg"), &Spatial::_set_rotation_deg);
|
||||
ClassDB::bind_method(D_METHOD("_get_rotation_deg"), &Spatial::_get_rotation_deg);
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
ClassDB::bind_method(D_METHOD("_update_gizmo"), &Spatial::_update_gizmo);
|
||||
#endif
|
||||
|
@ -106,10 +106,6 @@ class Spatial : public Node {
|
||||
void _notify_dirty();
|
||||
void _propagate_transform_changed(Spatial *p_origin);
|
||||
|
||||
// Deprecated, should be removed in a future version.
|
||||
void _set_rotation_deg(const Vector3 &p_euler_deg);
|
||||
Vector3 _get_rotation_deg() const;
|
||||
|
||||
void _propagate_visibility_changed();
|
||||
|
||||
protected:
|
||||
|
@ -2424,16 +2424,6 @@ float Control::get_rotation_deg() const {
|
||||
return Math::rad2deg(get_rotation());
|
||||
}
|
||||
|
||||
// Kept for compatibility after rename to {s,g}et_rotation_deg.
|
||||
// Could be removed after a couple releases.
|
||||
void Control::_set_rotation_deg(float p_degrees) {
|
||||
WARN_PRINT("Deprecated method Control._set_rotation_deg(): This method was renamed to set_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
set_rotation_deg(p_degrees);
|
||||
}
|
||||
float Control::_get_rotation_deg() const {
|
||||
WARN_PRINT("Deprecated method Control._get_rotation_deg(): This method was renamed to get_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
return get_rotation_deg();
|
||||
}
|
||||
//needed to update the control if the font changes..
|
||||
void Control::_ref_font(Ref<Font> p_sc) {
|
||||
|
||||
@ -2607,8 +2597,6 @@ void Control::_bind_methods() {
|
||||
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);
|
||||
// TODO: Obsolete this method (old name) properly (GH-4397)
|
||||
ClassDB::bind_method(D_METHOD("_set_rotation_deg", "degrees"), &Control::_set_rotation_deg);
|
||||
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);
|
||||
@ -2618,8 +2606,6 @@ void Control::_bind_methods() {
|
||||
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);
|
||||
// TODO: Obsolete this method (old name) properly (GH-4397)
|
||||
ClassDB::bind_method(D_METHOD("_get_rotation_deg"), &Control::_get_rotation_deg);
|
||||
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);
|
||||
|
@ -226,10 +226,6 @@ private:
|
||||
void _size_changed();
|
||||
String _get_tooltip() const;
|
||||
|
||||
// Deprecated, should be removed in a future version.
|
||||
void _set_rotation_deg(float p_degrees);
|
||||
float _get_rotation_deg() const;
|
||||
|
||||
void _ref_font(Ref<Font> p_sc);
|
||||
void _unref_font(Ref<Font> p_sc);
|
||||
void _font_changed();
|
||||
|
@ -115,20 +115,6 @@ real_t CanvasLayer::get_rotationd() const {
|
||||
return Math::rad2deg(get_rotation());
|
||||
}
|
||||
|
||||
// Kept for compatibility after rename to {s,g}et_rotationd.
|
||||
// Could be removed after a couple releases.
|
||||
void CanvasLayer::_set_rotationd(real_t p_degrees) {
|
||||
|
||||
WARN_PRINT("Deprecated method CanvasLayer._set_rotationd(): This method was renamed to set_rotationd. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
set_rotationd(p_degrees);
|
||||
}
|
||||
|
||||
real_t CanvasLayer::_get_rotationd() const {
|
||||
|
||||
WARN_PRINT("Deprecated method CanvasLayer._get_rotationd(): This method was renamed to get_rotationd. Please adapt your code accordingly, as the old method will be obsoleted.");
|
||||
return get_rotationd();
|
||||
}
|
||||
|
||||
void CanvasLayer::set_scale(const Vector2 &p_scale) {
|
||||
|
||||
if (locrotscale_dirty)
|
||||
@ -255,10 +241,6 @@ void CanvasLayer::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_rotationd", "degrees"), &CanvasLayer::set_rotationd);
|
||||
ClassDB::bind_method(D_METHOD("get_rotationd"), &CanvasLayer::get_rotationd);
|
||||
|
||||
// TODO: Obsolete those two methods (old name) properly (GH-4397)
|
||||
ClassDB::bind_method(D_METHOD("_set_rotationd", "degrees"), &CanvasLayer::_set_rotationd);
|
||||
ClassDB::bind_method(D_METHOD("_get_rotationd"), &CanvasLayer::_get_rotationd);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_scale", "scale"), &CanvasLayer::set_scale);
|
||||
ClassDB::bind_method(D_METHOD("get_scale"), &CanvasLayer::get_scale);
|
||||
|
||||
|
@ -54,10 +54,6 @@ class CanvasLayer : public Node {
|
||||
|
||||
int sort_index;
|
||||
|
||||
// Deprecated, should be removed in a future version.
|
||||
void _set_rotationd(real_t p_degrees);
|
||||
real_t _get_rotationd() const;
|
||||
|
||||
void _update_xform();
|
||||
void _update_locrotscale();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user