private void createClickableShapes() {
		List<Shape> shapes = new ArrayList<>();
		Rectangle r = null;
		PathIterator it = arrowBody.getPathIterator(null);
		float[] coords = new float[6];
		double lastx = 0;
		double lasty = 0;
		while (!it.isDone()) {
			int type = it.currentSegment(coords);
			switch (type) {
				case (PathIterator.SEG_MOVETO):
					if (r != null) {
						throw new AssertException("Founds a flow arrow shape without a line");
					}

					r = new Rectangle((int) coords[0], (int) coords[1], 0, 0);
					break;
				case (PathIterator.SEG_LINETO):

					// handle drawing from line-to-line, without a move
					if (r == null) {
						// not sure if this ever happens
						r = new Rectangle((int) lastx, (int) lasty);
					}

					lastx = coords[0];
					lasty = coords[1];
					Rectangle shape = buildRectangle(r, lastx, lasty);
					shapes.add(shape);
					r = null;
					break;
				case (PathIterator.SEG_CLOSE):
					if (r != null) {
						throw new AssertException("Founds a flow arrow shape without a line");
					}
					break;
				default:
					throw new AssertException("Unhandled path type!");
			}
			it.next();
		}

		clickableShapes = shapes;
	}
Call when the screen moves so that the shape can be updated
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/flowarrow/FlowArrow.java