From 7be08d16c074be2fc11d6e3204c745a7c74686a8 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Fri, 14 Aug 2020 13:47:48 +0200 Subject: [PATCH] Follow caret fix (#945) --- .../src/main/java/org/fxmisc/richtext/GenericStyledArea.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java index 12c229e68..aec90836f 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java @@ -1729,7 +1729,7 @@ public void dispose() { private void followCaret() { int parIdx = getCurrentParagraph(); Cell, ParagraphBox> cell = virtualFlow.getCell(parIdx); - Bounds caretBounds = cell.getNode().getCaretBounds(caretSelectionBind.getUnderlyingCaret()); + Bounds caretBounds = caretSelectionBind.getUnderlyingCaret().getLayoutBounds(); double graphicWidth = cell.getNode().getGraphicPrefWidth(); Bounds region = extendLeft(caretBounds, graphicWidth); double scrollX = virtualFlow.getEstimatedScrollX();