summaryrefslogtreecommitdiff
path: root/core/math/vector2.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-09 14:57:42 +0200
committerGitHub <noreply@github.com>2020-09-09 14:57:42 +0200
commita63ac0f8e04a7a953bebe247908573c530548609 (patch)
tree2c76e01fc7a249afb189edda80b2e43ffad226af /core/math/vector2.h
parent4d34677623e2551fc72e09ffdffe0323a75db5fd (diff)
parentd0a1399a1b7ef6b76f6e6094fb6dd6bd9b43d2c8 (diff)
Merge pull request #41894 from aaronfranke/ineq-exact
Change vector inequality comparison operators to use exact equality
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r--core/math/vector2.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h
index 8a08d3bf64..0966d3392f 100644
--- a/core/math/vector2.h
+++ b/core/math/vector2.h
@@ -114,10 +114,10 @@ struct Vector2 {
bool operator==(const Vector2 &p_vec2) const;
bool operator!=(const Vector2 &p_vec2) const;
- bool operator<(const Vector2 &p_vec2) const { return Math::is_equal_approx(x, p_vec2.x) ? (y < p_vec2.y) : (x < p_vec2.x); }
- bool operator>(const Vector2 &p_vec2) const { return Math::is_equal_approx(x, p_vec2.x) ? (y > p_vec2.y) : (x > p_vec2.x); }
- bool operator<=(const Vector2 &p_vec2) const { return Math::is_equal_approx(x, p_vec2.x) ? (y <= p_vec2.y) : (x < p_vec2.x); }
- bool operator>=(const Vector2 &p_vec2) const { return Math::is_equal_approx(x, p_vec2.x) ? (y >= p_vec2.y) : (x > p_vec2.x); }
+ bool operator<(const Vector2 &p_vec2) const { return x == p_vec2.x ? (y < p_vec2.y) : (x < p_vec2.x); }
+ bool operator>(const Vector2 &p_vec2) const { return x == p_vec2.x ? (y > p_vec2.y) : (x > p_vec2.x); }
+ bool operator<=(const Vector2 &p_vec2) const { return x == p_vec2.x ? (y <= p_vec2.y) : (x < p_vec2.x); }
+ bool operator>=(const Vector2 &p_vec2) const { return x == p_vec2.x ? (y >= p_vec2.y) : (x > p_vec2.x); }
real_t angle() const;