Files
sbox-public/engine/Sandbox.System/UI/RotationDegrees.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

20 lines
461 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace Sandbox
{
internal static class StyleHelpers
{
static internal float RotationDegrees( float val, string unit )
{
if ( unit.StartsWith( "grad" ) ) return val.GradiansToDegrees();
if ( unit.StartsWith( "rad" ) ) return val.RadianToDegree();
if ( unit.StartsWith( "turn" ) ) return val * 360.0f;
if ( unit.StartsWith( "deg" ) ) return val;
return val;
}
}
}