namespace Sandbox.UI;
///
/// Describes panel's position and size for rendering operations.
///
public readonly struct RenderState
{
///
/// Position of the panel on the X axis. This can be a negative value!
///
public float X { readonly get; init; }
///
/// Position of the panel on the Y axis. This can be a negative value!
///
public float Y { readonly get; init; }
///
/// Width of the panel.
///
public float Width { readonly get; init; }
///
/// Height of the panel.
///
public float Height { readonly get; init; }
///
/// Render Opacity Overrides
///
internal float RenderOpacity { readonly get; init; }
///
/// Allows easy cast to a for usage in rendering functions.
///
public static implicit operator Rect( RenderState rs ) => new( rs.X, rs.Y, rs.Width, rs.Height );
}