Fix inverse length in Vector2Normalize

Following the pattern in Vector3Normalize.
This commit is contained in:
HarriP 2021-12-06 02:17:55 +02:00
parent 895f5ddd98
commit 8a59b16deb

View File

@ -328,8 +328,9 @@ RMAPI Vector2 Vector2Normalize(Vector2 v)
if (length > 0)
{
result.x = v.x*1.0f/length;
result.y = v.y*1.0f/length;
float ilength = 1.0f / length;
result.x = v.x * ilength;
result.y = v.y * ilength;
}
return result;