MonoGameUi.Control.GetMaxClientSize C# (CSharp) Method

GetMaxClientSize() public method

Ermittelt die maximale Größe des Client Bereichs für dieses Control.
public GetMaxClientSize ( Point containerSize ) : Point
containerSize Point
return Point
        public Point GetMaxClientSize(Point containerSize)
        {
            int x = Width.HasValue ? Width.Value : containerSize.X;

            // Max Limiter
            if (MaxWidth.HasValue)
                x = Math.Min(MaxWidth.Value, x);

            // Min Limiter
            if (MinWidth.HasValue)
                x = Math.Max(MinWidth.Value, x);

            int y = Height.HasValue ? Height.Value : containerSize.Y;

            // Max Limiter
            if (MaxHeight.HasValue)
                y = Math.Min(MaxHeight.Value, y);

            // Min Limiter
            if (MinHeight.HasValue)
                y = Math.Max(MinHeight.Value, y);

            return new Point(x, y) - Borders;
        }