Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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;
Exemplo n.º 3
0
 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;
Exemplo n.º 4
0
 public Rectangle2 Union(Rectangle2 other) =>
 new Rectangle2(Vector2.Min(Start, other.Start), Vector2.Max(End, other.End));
Exemplo n.º 5
0
 public Rectangle2 Intersect(Rectangle2 other) =>
 new Rectangle2(Vector2.Max(Start, other.Start), Vector2.Min(End, other.End));
Exemplo n.º 6
0
 public bool Equals(Rectangle2 other) => this == other;