public int pickOffsetAtPosition(double x, double y) {
		HexCell closestChild = null;
		double closestDistance = Integer.MAX_VALUE;
		int offset = -1;
		for (Node child : layout.getChildren()) {
			if (child instanceof HexCell cell) {
				int bufferZone = 2;
				double centerX = cell.node().getBoundsInParent().getCenterX();
				double distance = Math.abs(centerX - x);
				if (distance < closestDistance) {
					closestDistance = distance;
					closestChild = cell;
					offset = cell.offset();
				}
			}
		}

		// Toggle navigation columns if the clicked column is not the current column.
		if (ops.navigation().isHexColumnSelected() != closestChild instanceof EditableHexCell)
			ops.navigation().switchColumns();

		return offset;
	}
@param x
		Layout x position.
@param y
		Layout y position.

@return Offset into the data for the closest cell to the given coordinates.
recaf-ui/src/main/java/software/coley/recaf/ui/pane/editing/hex/cell/HexRow.java