summaryrefslogtreecommitdiffstats
path: root/core/math/vector2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/vector2.cpp')
-rw-r--r--core/math/vector2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp
index 46a08b53ab..ab114673d8 100644
--- a/core/math/vector2.cpp
+++ b/core/math/vector2.cpp
@@ -128,8 +128,8 @@ Vector2 Vector2::snapped(const Vector2 &p_step) const {
Math::snapped(y, p_step.y));
}
-Vector2 Vector2::clamped(real_t p_len) const {
- real_t l = length();
+Vector2 Vector2::limit_length(const real_t p_len) const {
+ const real_t l = length();
Vector2 v = *this;
if (l > 0 && p_len < l) {
v /= l;