diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-11-11 13:20:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-11 13:20:19 +0100 |
| commit | fb2151089cea5da6c2293894f9686db6d50fbf92 (patch) | |
| tree | 6e1faa845af77a09f3ad65cd023b9f7c3fe81f90 /modules/mono/glue | |
| parent | acb7d99fce31ab99a807a76003815f09e98f62c8 (diff) | |
| parent | ee79fc627c18d26221adeae2b641ba81ba662184 (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.cs | 3 |
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; |