V2/Cet/HW/Cet.HW.GDI/Geometries/Rectangle.cs
/// <summary>
/// Enlarges this Rectangle by the specified amount.
/// </summary>
/// <param name="dx">The amount to inflate this Rectangle horizontally.</param>
/// <param name="dy">The amount to inflate this Rectangle vertically.</param>
Enlarges this Rectangle by the specified amount.
Enlarges this Rectangle by the specified amount .
public void Inflate(
            int dx,
            int dy)
        {
            if (this.IsEmpty)
                return;
            var width = this._width + 2 * dx;
            if (width > 0)
            {
                this.X -= dx;
                this._width = width;
            }
            else
            {
                this.X += this._width / 2;
                this._width = 0;
            }
            var height = this._height + 2 * dy;
            if (height > 0)
            {
                this.Y -= dy;
                this._height = height;
            }
            else
            {
                this.Y += this._height / 2;
                this._height = 0;
            }
        }
public void Inflate ( int dx , int dy ) { if ( this . IsEmpty ) return ; var width = this . _width + 2 * dx ; if ( width > 0 ) { this . X -= dx ; this . _width = width ; } else { this . X += this . _width / 2 ; this . _width = 0 ; } var height = this . _height + 2 * dy ; if ( height > 0 ) { this . Y -= dy ; this . _height = height ; } else { this . Y += this . _height / 2 ; this . _height = 0 ; } }
Enlarges this Rectangle by the specified amount.
Enlarges this Rectangle by the specified amount .
dx
int
The amount to inflate this Rectangle horizontally.
The amount to inflate this Rectangle horizontally .
dy
int
The amount to inflate this Rectangle vertically.
The amount to inflate this Rectangle vertically .