diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-07 22:21:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-07 22:21:43 +0200 |
commit | 39f9c4d229dfffe7ba4b00571e0cb4b65a36b0d5 (patch) | |
tree | 4e2e1d8307478cd86c64b00d23931c686a494d96 /core/math/rect2.h | |
parent | 7ca49be7ed0bc2b32adfad81db1278e841e2fe0c (diff) | |
parent | 43722dbcbc1e164ab8b9008395c650edb1d977db (diff) |
Merge pull request #67011 from aaronfranke/color-float-literals
Use float literals for float calculations in Color and misc core cleanup
Diffstat (limited to 'core/math/rect2.h')
-rw-r--r-- | core/math/rect2.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h index 5ed2f8236c..50dd2dc1df 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -178,7 +178,7 @@ struct _NO_DISCARD_ Rect2 { new_rect.size.x = MAX(p_rect.position.x + p_rect.size.x, position.x + size.x); new_rect.size.y = MAX(p_rect.position.y + p_rect.size.y, position.y + size.y); - new_rect.size = new_rect.size - new_rect.position; //make relative again + new_rect.size = new_rect.size - new_rect.position; // Make relative again. return new_rect; } @@ -253,7 +253,7 @@ struct _NO_DISCARD_ Rect2 { return r; } - inline void expand_to(const Vector2 &p_vector) { //in place function for speed + inline void expand_to(const Vector2 &p_vector) { // In place function for speed. #ifdef MATH_CHECKS if (unlikely(size.x < 0 || size.y < 0)) { ERR_PRINT("Rect2 size is negative, this is not supported. Use Rect2.abs() to get a Rect2 with a positive size."); @@ -311,7 +311,7 @@ struct _NO_DISCARD_ Rect2 { continue; } - //check inside + // Check inside. Vector2 tg = r.orthogonal(); float s = tg.dot(center) - tg.dot(a); if (s < 0.0f) { @@ -320,7 +320,7 @@ struct _NO_DISCARD_ Rect2 { side_minus++; } - //check ray box + // Check ray box. r /= l; Vector2 ir(1.0f / r.x, 1.0f / r.y); @@ -341,7 +341,7 @@ struct _NO_DISCARD_ Rect2 { } if (side_plus * side_minus == 0) { - return true; //all inside + return true; // All inside. } else { return false; } |