adjacent
Adjusts the dimensions and position of the rectangle based on the provided parameters. The method calculates the new dimensions and coordinates of the rectangle based on specified values for left, right, top, bottom, width, or height. If conflicting parameters are provided (e.g., both left
and right
or top
and bottom
), an error is thrown.
Return
A new Rectangle with the adjusted dimensions and position.
Parameters
Optional offset to adjust the left side of the rectangle. If provided along with right
, an error is thrown.
Optional offset to adjust the right side of the rectangle. If provided along with left
, an error is thrown.
Optional offset to adjust the top side of the rectangle. If provided along with bottom
, an error is thrown.
Optional offset to adjust the bottom side of the rectangle. If provided along with top
, an error is thrown.
Optional value to override the width of the rectangle. Ignored if both left
and right
are provided.
Optional value to override the height of the rectangle. Ignored if both top
and bottom
are provided.