public Rectangle drawRectangle(Color c, Rectangle r, int padding, int thickness) {
		r.x -= padding;
		r.y -= padding;
		r.width += (2 * padding);
		r.height += (2 * padding);
		drawRectangle(c, r, thickness);
		return r;
	}
Draws a rectangle around the given component. The root parameter is used to calculate screen
coordinates. This allows you to capture a sub-component of a UI, drawing rectangles around
children of said sub-component.

<P>
If you are unsure of what to pass for <code>root</code>, the call
{@link #drawRectangleAround(JComponent, Color, int)} instead.

@param component the component to be en-rectangled
@param root the outermost container widget being displayed; null implies a top-level parent
@param color the rectangle color
@param padding the space between the rectangle and the component; more space makes the
           component more visible
@return the bounds of the drawn rectangle
Ghidra/Features/Base/src/main/java/help/screenshot/AbstractScreenShotGenerator.java