You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a selection of text in the area is on the right side outside of the visible area and GenericStyledArea.requestFollowCaret() is called, the flow scrolls only to the start of the selection, but the selection itself remains outside on the right.
This happens when the horizontal scrollbar is more far away from the beginning.
I made this change and it works now.
Only the relevant code shown. My comment [A]
privatevoidfollowCaret() {
// ...doublegraphicWidth = paragrafBox.getGraphicPrefWidth();
Boundsregion = extendLeft(caretBounds, graphicWidth);
doublescrollX = virtualFlow.getEstimatedScrollX();
// Ordinarily when a caret ends a selection in the target paragraph and scrolling left is required to follow // the caret then the selection won't be visible. So here we check for this scenario and adjust if needed.if ( ! isWrapText() && scrollX > 0.0 && getParagraphSelection( parIdx ).getLength() > 0 )
{
// [A] visibleLeftX has a rather large value when scrollX is big. This works fine for a selection outside the area// on the left but keeps a selection on the right outside the area. doublevisibleLeftX = paragrafBox.getWidth() * scrollX / 100 - getWidth() + graphicWidth;
CaretNodeselectionStart = newCaretNode( "", this, getSelection().getStart() );
paragrafBox.caretsProperty().add( selectionStart );
BoundsstartBounds = paragrafBox.getCaretBounds( selectionStart );
paragrafBox.caretsProperty().remove( selectionStart );
// [A] I use this changed condition and it works for both left and right.// startBounds.getMinX() - graphicWidth < scrollXif ( startBounds.getMinX() - graphicWidth < visibleLeftX ) {
region = extendLeft( startBounds, graphicWidth );
}
}
// ...
}
The text was updated successfully, but these errors were encountered:
When a selection of text in the area is on the right side outside of the visible area and GenericStyledArea.requestFollowCaret() is called, the flow scrolls only to the start of the selection, but the selection itself remains outside on the right.
This happens when the horizontal scrollbar is more far away from the beginning.
I made this change and it works now.
Only the relevant code shown. My comment [A]
The text was updated successfully, but these errors were encountered: