summaryrefslogtreecommitdiff
path: root/core/math/vector2.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-21 14:26:31 +0200
committerGitHub <noreply@github.com>2021-07-21 14:26:31 +0200
commit59d98ed3bb1ed744600e599f997c817f63157d83 (patch)
tree309f83d89ea6d0c58b31232bbdc8a5a8cab45de0 /core/math/vector2.h
parente978b46b0f6d7ba37a00ed64d840a12ffd9efa48 (diff)
parent5d34a81e52877034295fc79e4f4b01d0cfa7dfb1 (diff)
Merge pull request #50643 from groud/improve_tilemap_compatibility
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r--core/math/vector2.h8
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));
}