@Override public Box getCaretShape() { TextLocation caretLocation = getCaretLocation(); TypedLayout line = getLines().get(caretLocation.line); Box caretShape = line.getCaretShape(caretLocation.index); caretShape.translate(getXOffset(line), getY(caretLocation)); return caretShape; }