diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java index aec90836f..2f09d975a 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java @@ -1750,6 +1750,16 @@ private void followCaret() { } } + // Addresses https://github.com/FXMisc/RichTextFX/issues/937#issuecomment-674319602 + if ( parIdx == getParagraphs().size()-1 && cell.getNode().getLineCount() == 1 ) + { + region = new BoundingBox // Correcting the region's height + ( + region.getMinX(), region.getMinY(), region.getWidth(), + cell.getNode().getLayoutBounds().getHeight() + ); + } + virtualFlow.show(parIdx, region); }