Source/NFX/Geometry/CartesianUtils.cs
/// <summary>
/// Calculates an area of an inner rectangle that violates outside perimeter
/// </summary>
Calculates an area of an inner rectangle that violates outside perimeter
Calculates an area of an inner rectangle that violates outside perimeter
public static int CalculatePerimeterViolationArea(Rectangle perimeter, Rectangle inner)
    {
      int ix = 0;
      int iy = 0;
      if (inner.Left<perimeter.Left) ix += perimeter.Left - inner.Left;
        if (inner.Right>perimeter.Right) ix += inner.Right - perimeter.Right;
      if (inner.Top < perimeter.Top) iy += perimeter.Top - inner.Top;
        if (inner.Bottom > perimeter.Bottom) iy += inner.Bottom - perimeter.Bottom;
      return (ix * inner.Height) + (iy * inner.Width);
    }
public static int CalculatePerimeterViolationArea ( Rectangle perimeter , Rectangle inner ) { int ix = 0 ; int iy = 0 ; if ( inner . Left < perimeter . Left ) ix += perimeter . Left - inner . Left ; if ( inner . Right > perimeter . Right ) ix += inner . Right - perimeter . Right ; if ( inner . Top < perimeter . Top ) iy += perimeter . Top - inner . Top ; if ( inner . Bottom > perimeter . Bottom ) iy += inner . Bottom - perimeter . Bottom ; return ( ix * inner . Height ) + ( iy * inner . Width ) ; }
Calculates an area of an inner rectangle that violates outside perimeter
Calculates an area of an inner rectangle that violates outside perimeter
//    else    fixed 20111102 DKh //    else    fixed 20111102 DKh
perimeter
Rectangle
inner
Rectangle