Exemplo n.º 1
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.º 2
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);
 }