public Rectangle2 Round() { Rectangle2 result = this; result.Start = new Vector2((float)Math.Floor(result.Start.X), (float)Math.Floor(result.Start.Y)); result.End = new Vector2((float)Math.Ceiling(result.End.X), (float)Math.Ceiling(result.End.Y)); return(result); }
public bool Intersects(Rectangle2 other) => Start.X <= other.End.X && End.X >= other.Start.X && Start.Y <= other.End.Y && End.Y >= other.Start.Y;
public bool Contains(Rectangle2 other) => Start.X <= other.Start.X && End.X >= other.End.X && Start.Y <= other.Start.Y && End.Y >= other.End.Y;
public Rectangle2 Union(Rectangle2 other) => new Rectangle2(Vector2.Min(Start, other.Start), Vector2.Max(End, other.End));
public Rectangle2 Intersect(Rectangle2 other) => new Rectangle2(Vector2.Max(Start, other.Start), Vector2.Min(End, other.End));
public bool Equals(Rectangle2 other) => this == other;