diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-12-06 14:01:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 14:01:45 +0100 |
commit | 5baf20e638a7a5ca140208f961c0b65a61c33734 (patch) | |
tree | a7596e98ea273c11e27a0422df036dd2dfd42df3 /core/math/vector2.h | |
parent | 608c9f820349ca13f017ea406c790d90729da837 (diff) | |
parent | 24f57886d087d78eb8dcf7be28d790cddadf2c99 (diff) |
Merge pull request #34005 from aaronfranke/minmax
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r-- | core/math/vector2.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h index 0a7b9d3faf..c0a189e040 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -70,12 +70,12 @@ struct Vector2 { x = y = p_value; } - _FORCE_INLINE_ int min_axis() const { - return x < y ? 0 : 1; + _FORCE_INLINE_ Vector2::Axis min_axis_index() const { + return x < y ? Vector2::AXIS_X : Vector2::AXIS_Y; } - _FORCE_INLINE_ int max_axis() const { - return x < y ? 1 : 0; + _FORCE_INLINE_ Vector2::Axis max_axis_index() const { + return x < y ? Vector2::AXIS_Y : Vector2::AXIS_X; } void normalize(); @@ -301,12 +301,12 @@ struct Vector2i { return p_idx ? y : x; } - _FORCE_INLINE_ int min_axis() const { - return x < y ? 0 : 1; + _FORCE_INLINE_ Vector2i::Axis min_axis_index() const { + return x < y ? Vector2i::AXIS_X : Vector2i::AXIS_Y; } - _FORCE_INLINE_ int max_axis() const { - return x < y ? 1 : 0; + _FORCE_INLINE_ Vector2i::Axis max_axis_index() const { + return x < y ? Vector2i::AXIS_Y : Vector2i::AXIS_X; } Vector2i min(const Vector2i &p_vector2i) const { |