Rectangle.grow

Rectangle.grow

Class Overview | Class Members | This Package | All Packages

Syntax
public void grow( int h, int v )
Parameters
h
the horizontal expansion.
v
the vertical expansion.
Description
Grows the rectangle both horizontally and vertically.

This method modifies the rectangle so that it is h units larger on both the left and right side, and v units larger at both the top and bottom.

The new rectangle has (x - h, y - v) as its top-left corner, a width of width + 2h, and a height of height + 2v.

If negative values are supplied for h and v, the size of the rectangle decreases accordingly. The grow method does not check whether the resulting values of width and height are non-negative.