Files
Dashboard/Dashboard.Common/Extents.cs
T
2026-09-08 21:33:03 +03:00

31 lines
804 B
C#

using System.Diagnostics;
using System.Numerics;
namespace Dashboard
{
[DebuggerDisplay("{Value}")]
public readonly record struct Extents(Vector4 Value)
{
public float Left => Value.X;
public float Top => Value.Y;
public float Right => Value.Z;
public float Bottom => Value.W;
public float ExtentWidth => Left + Right;
public float ExtentHeight => Top + Bottom;
public Vector2 ExtentSize => new(ExtentWidth, ExtentHeight);
public Extents(float left, float top, float right, float bottom)
: this(new Vector4(left, top, right, bottom))
{
}
public Extents(float value) : this(new Vector4(value))
{
}
public static readonly Extents None = new Extents(0);
}
}