public void setPoints(Point start, Point end) {

		int x1 = start.x;
		int y1 = start.y;
		int x2 = end.x;
		int y2 = end.y;

		int w = Math.abs(x2 - x1);
		int h = Math.abs(y2 - y1);
		if (w == 0) {
			x2 += 1;
		}
		if (h == 0) {
			y2 += 1;
		}

		Rectangle2D rect = (Rectangle2D) shape;
		rect.setFrameFromDiagonal(x1, y1, x2, y2);
		rebuildPaint(start, end);
	}
Paints a rectangle showing the start and end points of a drag.
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/renderer/MouseDraggedPaintableShape.java