File tree Expand file tree Collapse file tree
richtextfx/src/main/java/org/fxmisc/richtext Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1961,14 +1961,12 @@ private void followCaret() {
19611961 // the caret then the selection won't be visible. So here we check for this scenario and adjust if needed.
19621962 if ( ! isWrapText () && scrollX > 0.0 && getParagraphSelection ( parIdx ).getLength () > 0 )
19631963 {
1964- double visibleLeftX = paragrafBox .getWidth () * scrollX / 100 - getWidth () + graphicWidth ;
1965-
19661964 CaretNode selectionStart = new CaretNode ( "" , this , getSelection ().getStart () );
19671965 paragrafBox .caretsProperty ().add ( selectionStart );
19681966 Bounds startBounds = paragrafBox .getCaretBounds ( selectionStart );
19691967 paragrafBox .caretsProperty ().remove ( selectionStart );
19701968
1971- if ( startBounds .getMinX () - graphicWidth < visibleLeftX ) {
1969+ if ( startBounds .getMinX () - graphicWidth < scrollX ) {
19721970 region = extendLeft ( startBounds , graphicWidth );
19731971 }
19741972 }
You can’t perform that action at this time.
0 commit comments