diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:41:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 21:57:34 +0200 |
commit | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch) | |
tree | 198d4ff7665d89307f6ca2469fa38620a9eb1672 /scene/3d/remote_transform_3d.cpp | |
parent | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff) | |
download | redot-engine-0ee0fa42e6639b6fa474b7cf6afc6b1a78142185.tar.gz |
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
Diffstat (limited to 'scene/3d/remote_transform_3d.cpp')
-rw-r--r-- | scene/3d/remote_transform_3d.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/scene/3d/remote_transform_3d.cpp b/scene/3d/remote_transform_3d.cpp index 7872a8ee1c..95fce6b802 100644 --- a/scene/3d/remote_transform_3d.cpp +++ b/scene/3d/remote_transform_3d.cpp @@ -43,18 +43,22 @@ void RemoteTransform3D::_update_cache() { } void RemoteTransform3D::_update_remote() { - if (!is_inside_tree()) + if (!is_inside_tree()) { return; + } - if (cache.is_null()) + if (cache.is_null()) { return; + } Node3D *n = Object::cast_to<Node3D>(ObjectDB::get_instance(cache)); - if (!n) + if (!n) { return; + } - if (!n->is_inside_tree()) + if (!n->is_inside_tree()) { return; + } //todo make faster if (use_global_coordinates) { @@ -63,11 +67,13 @@ void RemoteTransform3D::_update_remote() { } else { Transform our_trans = get_global_transform(); - if (update_remote_rotation) + if (update_remote_rotation) { n->set_rotation(our_trans.basis.get_rotation()); + } - if (update_remote_scale) + if (update_remote_scale) { n->set_scale(our_trans.basis.get_scale()); + } if (update_remote_position) { Transform n_trans = n->get_global_transform(); @@ -83,11 +89,13 @@ void RemoteTransform3D::_update_remote() { } else { Transform our_trans = get_transform(); - if (update_remote_rotation) + if (update_remote_rotation) { n->set_rotation(our_trans.basis.get_rotation()); + } - if (update_remote_scale) + if (update_remote_scale) { n->set_scale(our_trans.basis.get_scale()); + } if (update_remote_position) { Transform n_trans = n->get_transform(); @@ -106,8 +114,9 @@ void RemoteTransform3D::_notification(int p_what) { } break; case NOTIFICATION_TRANSFORM_CHANGED: { - if (!is_inside_tree()) + if (!is_inside_tree()) { break; + } if (cache.is_valid()) { _update_remote(); |