Exemplo n.º 1
0
 public void Intersects(ref RectangleF value, out bool result)
 {
     result = value.Left < Right && Left < value.Right && value.Top < Bottom && Top < value.Bottom;
 }
Exemplo n.º 2
0
 public bool Equals(RectangleF other)
 {
     return this == other;
 }
Exemplo n.º 3
0
 public bool Intersects(RectangleF value)
 {
     if (value.Left < Right && Left < value.Right && value.Top < Bottom)
         return Top < value.Bottom;
     return false;
 }
Exemplo n.º 4
0
 public bool Contains(RectangleF value)
 {
     if (X <= value.X && value.X + value.Width <= X + Width && Y <= value.Y)
         return value.Y + value.Height <= Y + Height;
     return false;
 }
Exemplo n.º 5
0
 public static void Union(ref RectangleF value1, ref RectangleF value2, out RectangleF result)
 {
     result.X = Math.Min(value1.X, value2.X);
     result.Y = Math.Min(value1.Y, value2.Y);
     result.Width = Math.Max(value1.Right, value2.Right) - result.X;
     result.Height = Math.Max(value1.Bottom, value2.Bottom) - result.Y;
 }
Exemplo n.º 6
0
 public static RectangleF Union(RectangleF value1, RectangleF value2)
 {
     var x = Math.Min(value1.X, value2.X);
     var y = Math.Min(value1.Y, value2.Y);
     return new RectangleF(x, y, Math.Max(value1.Right, value2.Right) - x, Math.Max(value1.Bottom, value2.Bottom) - y);
 }
Exemplo n.º 7
0
 public static void Intersect(ref RectangleF value1, ref RectangleF value2, out RectangleF result)
 {
     if (value1.Intersects(value2))
     {
         var num1 = Math.Min(value1.X + value1.Width, value2.X + value2.Width);
         var x = Math.Max(value1.X, value2.X);
         var y = Math.Max(value1.Y, value2.Y);
         var num2 = Math.Min(value1.Y + value1.Height, value2.Y + value2.Height);
         result = new RectangleF(x, y, num1 - x, num2 - y);
     }
     else
         result = new RectangleF(0, 0, 0, 0);
 }
Exemplo n.º 8
0
 public static RectangleF Intersect(RectangleF value1, RectangleF value2)
 {
     RectangleF result;
     Intersect(ref value1, ref value2, out result);
     return result;
 }