private void doScrollTo(FieldLocation location) {
		if (layouts.isEmpty()) {
			return;
		}
		BigInteger locationIndex = location.getIndex();
		if (layouts.get(0).getIndex().compareTo(locationIndex) > 0) {
			showIndex(locationIndex, 0);
		}
		else if (layouts.get(layouts.size() - 1).getIndex().compareTo(locationIndex) < 0) {
			showIndex(locationIndex, getHeight() - 1);
		}

		AnchoredLayout layout = findLayoutOnScreen(locationIndex);

		if (layout == null) {
			layout = findClosestLayoutOnScreen(locationIndex);
			if (layout == null) {
				return;
			}
			locationIndex = layout.getIndex();
			location.setIndex(locationIndex);
		}

		Rectangle locationRect =
			layout.getCursorRect(location.fieldNum, location.row, location.col);

		JViewport vp = getViewport();
		if (vp != null) {
			// translate cursor rectangle to views coordinate system. (normally this has
			// no effect except when the view consists of a panel containing multiple field
			// panels, i.e. byte viewer)
			Rectangle r =
				SwingUtilities.convertRectangle(FieldPanel.this, locationRect, getParent());
			locationRect.x = r.x;
			// Unusual Code Alert!:
			// We are artificially making the cursor bigger here so that we will have padding
			// in the left and right edges of the screen as the user cursors around (4226).
			locationRect.x = Math.max(0, locationRect.x - 15);
			locationRect.width += 30;

			Rectangle viewRect = vp.getViewRect();
			if (viewRect.width > 0 && viewRect.height > 0) {
				if (locationRect.x < viewRect.x) {
					vp.setViewPosition(new Point(locationRect.x, viewRect.y));
				}
				else if (locationRect.x + locationRect.width > viewRect.x + viewRect.width) {
					vp.setViewPosition(new Point(
						locationRect.x + locationRect.width - viewRect.width, viewRect.y));
				}
			}
		}

		if (locationRect.y < 0) {
			scrollView(locationRect.y);
		}
		else if (locationRect.y + locationRect.height > getHeight()) {
			scrollView(locationRect.y + locationRect.height - getHeight());
		}
	}
Makes sure the location is completely visible on the screen. If it already is visible, this
routine will do nothing. If the location is above the screen (at an index less than the first
line on the screen), the view will be scrolled such that the location will appear at the top
of the screen. If the location is below the screen, the view will be scrolled such that the
location will appear at the bottom the screen. The layouts[] array will be updated to reflect
the current view.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java