#nullable enable
namespace Terminal.Gui;
///
/// Represents a position that is a percentage of the width or height of the SuperView.
///
///
///
/// 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 PosPercent (int percent) : Pos
{
///
/// Gets the percentage of the width or height of the SuperView.
///
public new int Percent { get; } = percent;
///
public override bool Equals (object? other) { return other is PosPercent i && i.Percent == Percent; }
///
public override int GetHashCode () { return Percent.GetHashCode (); }
///
public override string ToString () { return $"Percent({Percent})"; }
internal override int GetAnchor (int size) { return (int)(size * (Percent / 100f)); }
}