Tinkr2/4.2/AphelionCore/AphelionCore/Core/TypeDef.cs
/// <summary>
/// Adds the area of a second rectangle to current rectangle
/// </summary>
/// <param name="newRect">rectangle to add</param>
Adds the area of a second rectangle to current rectangle
Adds the area of a second rectangle to current rectangle
public void Combine(rect newRect)
      {
         if (_w == 0)
         {
            _x = newRect.X;
            _y = newRect.Y;
            _w = newRect.Width;
            _h = newRect.Height;
            return;
         }
         int x1 = (_x < newRect.X) ? _x : newRect.X;
         int y1 = (_y < newRect.Y) ? _y : newRect.Y;
         int x2 = (_x + Width > newRect.X + newRect.Width) ? _x + _w : newRect.X + newRect.Width;
         int y2 = (_y + Height > newRect.Y + newRect.Height) ? _y + _h : newRect.Y + newRect.Height;
         _x = x1;
         _y = y1;
         _w = x2 - x1;
         _h = y2 - y1;
      }
public void Combine ( rect newRect ) { if ( _w == 0 ) { _x = newRect . X ; _y = newRect . Y ; _w = newRect . Width ; _h = newRect . Height ; return ; } int x1 = ( _x < newRect . X ) ? _x : newRect . X ; int y1 = ( _y < newRect . Y ) ? _y : newRect . Y ; int x2 = ( _x + Width > newRect . X + newRect . Width ) ? _x + _w : newRect . X + newRect . Width ; int y2 = ( _y + Height > newRect . Y + newRect . Height ) ? _y + _h : newRect . Y + newRect . Height ; _x = x1 ; _y = y1 ; _w = x2 - x1 ; _h = y2 - y1 ; }
Adds the area of a second rectangle to current rectangle
Adds the area of a second rectangle to current rectangle
newRect
rect
rectangle to add
rectangle to add