#nullable enable
namespace Terminal.Gui;
///
/// Represents a position that is computed by executing a function that returns an integer position.
///
///
///
/// 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 position.
public class PosFunc (Func pos) : Pos
{
///
/// Gets the function that computes the position.
///
public new Func Func { get; } = pos;
///
public override bool Equals (object? other) { return other is PosFunc f && f.Func () == Func (); }
///
public override int GetHashCode () { return Func.GetHashCode (); }
///
public override string ToString () { return $"PosFunc({Func ()})"; }
internal override int GetAnchor (int size) { return Func (); }
}