Removed unnecessary in GetByteValueFromPercentage

This commit is contained in:
DarthAffe committed 2024-06-22 19:49:38 +02:00
1 parent f21acbd767
commit 6f0711564c
1 file changed
+1 -2
+1 -2
View File
@@ -91,9 +91,8 @@ public static class FloatExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static byte GetByteValueFromPercentage(this float percentage)
{
if (float.IsNaN(percentage)) return 0;
if (float.IsNaN(percentage) || (percentage <= 0)) return 0;
percentage = percentage.Clamp(0, 1.0f);
return (byte)(percentage >= 1.0f ? 255 : percentage * 256.0f);
}