public void drawArrow(Color c, int thickness, Point start, Point end, int arrowSize) {
		Graphics g = image.getGraphics();
		Graphics2D g2d = (Graphics2D) g;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		BasicStroke stroke = new BasicStroke(thickness);
		g2d.setStroke(stroke);
		g.setColor(c);

		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

		double unitX = 0;
		double unitY = 0;

		if (end.x == start.x) {
			unitY = 1;
		}
		else if (end.y == start.y) {
			unitX = 1;
		}
		else {
			double slope =
				((double) end.y - (double) start.y) / ((double) end.x - (double) start.x);
			double crossSlope = 1 / slope;
			unitX = Math.sqrt(1 / ((slope * slope) + 1));
			unitY = Math.sqrt(1 / ((crossSlope * crossSlope) + 1));
		}

		if (end.x < start.x) {
			unitX = -unitX;
		}
		if (end.y < start.y) {
			unitY = -unitY;
		}

		int crossx = end.x - (int) (unitX * arrowSize);
		int crossy = end.y - (int) (unitY * arrowSize);

		g.drawLine(start.x, start.y, crossx, crossy);

		int arrow1x = crossx - (int) (unitY * arrowSize);
		int arrow1y = crossy + (int) (unitX * arrowSize);
		int arrow2x = crossx + (int) (unitY * arrowSize);
		int arrow2y = crossy - (int) (unitX * arrowSize);

		Polygon p = new Polygon();
		p.addPoint(end.x, end.y);
		p.addPoint(arrow1x, arrow1y);
		p.addPoint(arrow2x, arrow2y);
		g.fillPolygon(p);
	}
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