private void prepareProblem(@Nonnull Problem problem, @Nonnull StackPane pane, int paragraph) {
		// Compute the width of the draw canvas and offset required
		int index = problem.column() + 1;
		double toStart = editor.computeWidthUntilCharacter(paragraph, index);
		double toEnd = editor.computeWidthUntilCharacter(paragraph, index + problem.length());
		toEnd = Math.max(toEnd, toStart + 6);
		double errorWidth = toEnd - toStart;

		// Create the overlay
		Canvas canvas = new Canvas(errorWidth, containerHeight);
		canvas.setManaged(false);
		canvas.setMouseTransparent(true);
		canvas.setTranslateY(3);
		canvas.setTranslateX(toStart + 1.7);

		pane.getChildren().add(canvas);

		drawWaves(canvas, problem.level() == ProblemLevel.WARN, errorWidth);

		Tooltip tooltip = new Tooltip(problem.message());
		Tooltip.install(canvas, tooltip);
	}
Adds the given problem to the stack pane.

@param problem
		Problem to add.
@param pane
		Pane to add the problem display to.
@param paragraph
		Current paragraph index.
recaf-ui/src/main/java/software/coley/recaf/ui/control/richtext/problem/ProblemSquiggleGraphicFactory.java