diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-21 14:26:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-21 14:26:31 +0200 |
commit | 59d98ed3bb1ed744600e599f997c817f63157d83 (patch) | |
tree | 309f83d89ea6d0c58b31232bbdc8a5a8cab45de0 /core/math/vector2.h | |
parent | e978b46b0f6d7ba37a00ed64d840a12ffd9efa48 (diff) | |
parent | 5d34a81e52877034295fc79e4f4b01d0cfa7dfb1 (diff) |
Merge pull request #50643 from groud/improve_tilemap_compatibility
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r-- | core/math/vector2.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h index 78deb473b4..4d9f3126e9 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -300,6 +300,14 @@ struct Vector2i { return p_idx ? y : x; } + _FORCE_INLINE_ int min_axis() const { + return x < y ? 0 : 1; + } + + _FORCE_INLINE_ int max_axis() const { + return x < y ? 1 : 0; + } + Vector2i min(const Vector2i &p_vector2i) const { return Vector2(MIN(x, p_vector2i.x), MIN(y, p_vector2i.y)); } |