inset_r
Description:
Changes the given rectangle to be smaller, or larger depending on the given inset parameters.
To create an inset rectangle, use positive d_x
or d_y
values; to create a larger, encompassing rectangle, use
negative d_x
or d_y
values.
The origin of the rectangle is offset by d_x
and d_y
, while the size is adjusted by `(2 * d_x
, 2 *
d_y
)`. If d_x
and d_y
are positive values, the size of the rectangle is decreased; if d_x
and d_y
are negative values, the size of the rectangle is increased.
If the size of the resulting inset rectangle has a negative width or height then the size will be set to zero.
Parameters:
this |
a Rect |
d_x |
the horizontal inset |
d_y |
the vertical inset |
res |
return location for the inset rectangle |