#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.
///
///
public class DimFunc (Func dim) : Dim
{
///
public override bool Equals (object? other) { return other is DimFunc f && f.Func () == Func (); }
///
/// Gets the function that computes the dimension.
///
public new Func Func { get; } = dim;
///
public override int GetHashCode () { return Func.GetHashCode (); }
///
public override string ToString () { return $"DimFunc({Func ()})"; }
internal override int GetAnchor (int size) { return Func (); }
}