PixelFarm.Agg.RectInt.Clip C# (CSharp) Method

Clip() public method

public Clip ( RectInt r ) : bool
r RectInt
return bool
        public bool Clip(RectInt r)
        {
            if (Right > r.Right) Right = r.Right;
            if (Top > r.Top) Top = r.Top;
            if (Left < r.Left) Left = r.Left;
            if (Bottom < r.Bottom) Bottom = r.Bottom;
            return Left <= Right && Bottom <= Top;
        }