public static RectangleI Inflate(RectangleI rect, int x, int y) { RectangleI rectangleI = rect; rectangleI.Inflate(x, y); return(rectangleI); }
public static RectangleI Union(RectangleI a, RectangleI b) { int x = Math.Min(a.X, b.X); int num1 = Math.Max(a.X + a.Width, b.X + b.Width); int y = Math.Min(a.Y, b.Y); int num2 = Math.Max(a.Y + a.Height, b.Y + b.Height); return(new RectangleI(x, y, num1 - x, num2 - y)); }
public void Intersect(RectangleI rect) { RectangleI RectangleI = Intersect(rect, this); x = RectangleI.X; y = RectangleI.Y; width = RectangleI.Width; height = RectangleI.Height; }
public static RectangleI Intersect(RectangleI a, RectangleI b) { int x = Math.Max(a.X, b.X); int num1 = Math.Min(a.X + a.Width, b.X + b.Width); int y = Math.Max(a.Y, b.Y); int num2 = Math.Min(a.Y + a.Height, b.Y + b.Height); return(num1 >= x && num2 >= y ? new RectangleI(x, y, num1 - x, num2 - y) : Empty); }
public override bool Equals(object obj) { if (!(obj is RectangleI)) { return(false); } RectangleI rectangleI = (RectangleI)obj; return(rectangleI.X == x && rectangleI.Y == y && rectangleI.Width == width && rectangleI.Height == height); }
public bool IntersectsWith(RectangleI rect) { return(rect.X < x + width && x < rect.X + rect.Width && rect.Y < y + height && y < rect.Y + rect.Height); }
public bool Contains(RectangleI rect) { return(x <= rect.X && rect.X + rect.Width <= X + Width && Y <= rect.Y && rect.Y + rect.Height <= Y + Height); }