summaryrefslogtreecommitdiffstats
path: root/scene/resources/capsule_shape_2d.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:41:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 21:57:34 +0200
commit0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch)
tree198d4ff7665d89307f6ca2469fa38620a9eb1672 /scene/resources/capsule_shape_2d.cpp
parent07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff)
downloadredot-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/resources/capsule_shape_2d.cpp')
-rw-r--r--scene/resources/capsule_shape_2d.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp
index 1054365459..0e784e04ff 100644
--- a/scene/resources/capsule_shape_2d.cpp
+++ b/scene/resources/capsule_shape_2d.cpp
@@ -39,8 +39,9 @@ Vector<Vector2> CapsuleShape2D::_get_points() const {
Vector2 ofs = Vector2(0, (i > 6 && i <= 18) ? -get_height() * 0.5 : get_height() * 0.5);
points.push_back(Vector2(Math::sin(i * Math_PI * 2 / 24.0), Math::cos(i * Math_PI * 2 / 24.0)) * get_radius() + ofs);
- if (i == 6 || i == 18)
+ if (i == 6 || i == 18) {
points.push_back(Vector2(Math::sin(i * Math_PI * 2 / 24.0), Math::cos(i * Math_PI * 2 / 24.0)) * get_radius() - ofs);
+ }
}
return points;
@@ -66,8 +67,9 @@ real_t CapsuleShape2D::get_radius() const {
void CapsuleShape2D::set_height(real_t p_height) {
height = p_height;
- if (height < 0)
+ if (height < 0) {
height = 0;
+ }
_update_shape();
}