Package: graphene

Function graphene:rect-inset

Lambda List

graphene:rect-inset (rect dx dy result)

Arguments

rect -- a graphene:rect-t instance
dx -- a number coerced to a single float for the horizontal inset
dy -- a number coerced to a single float for the vertical inset
result -- a graphene:rect-t instance for the result

Return Value

The graphene:rect-t instance with the inset rectangle.

Details

Changes the given rectangle to be smaller, or larger depending on the given inset parameters. To create an inset rectangle, use positive dx or dy values. To create a larger, encompassing rectangle, use negative dx or dy values.

The origin of the rectangle is offset by dx and dy, while the size is adjusted by (2 * dx, 2 * dy). If dx and dy are positive values, the size of the rectangle is decreased. If dx and dy 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.
 

See also

2025-3-8