summaryrefslogtreecommitdiff
path: root/modules/mono/glue
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-11-11 13:20:19 +0100
committerGitHub <noreply@github.com>2020-11-11 13:20:19 +0100
commitfb2151089cea5da6c2293894f9686db6d50fbf92 (patch)
tree6e1faa845af77a09f3ad65cd023b9f7c3fe81f90 /modules/mono/glue
parentacb7d99fce31ab99a807a76003815f09e98f62c8 (diff)
parentee79fc627c18d26221adeae2b641ba81ba662184 (diff)
Merge pull request #43372 from aaronfranke/clamp-fixes
Minor clamp and float fixes
Diffstat (limited to 'modules/mono/glue')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs
index 06bbe98497..bc0f81b2a7 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs
@@ -221,8 +221,7 @@ namespace Godot
real_t dot = v1.Dot(v2);
- // Clamp dot to [-1, 1]
- dot = dot < -1.0f ? -1.0f : (dot > 1.0f ? 1.0f : dot);
+ dot = Mathf.Clamp(dot, -1.0f, 1.0f);
Vector2 v;