#nullable enable
namespace Terminal.Gui;
///
/// Represents a function object that computes the dimension by executing the provided function.
///
///
/// This is a low-level API that is typically used internally by the layout system. Use the various static
/// methods on the class to create objects instead.
///
/// The function that computes the dimension. If this function throws ...
public record DimFunc (Func Fn) : Dim
{
///
/// Gets the function that computes the dimension.
///
public Func Fn { get; } = Fn;
///
public override string ToString () { return $"DimFunc({Fn ()})"; }
internal override int GetAnchor (int size) { return Fn (); }
}