Skip to content

Commit 3c9578f

Browse files
authored
Fix nonwrap line highlighter width (#948)
1 parent f630e82 commit 3c9578f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ public void setLineHighlighterOn( boolean show )
12361236
path.getElements().addListener( (Change<? extends PathElement> chg) ->
12371237
{
12381238
if ( chg.next() && chg.wasAdded() || chg.wasReplaced() ) {
1239-
double width = getLayoutBounds().getWidth();
1239+
double width = path.getParent().getLayoutBounds().getWidth();
12401240
// The path is limited to the bounds of the text, so here it's altered to the area's width
12411241
chg.getAddedSubList().stream().skip(1).limit(2).forEach( ele -> ((LineTo) ele).setX( width ) );
12421242
// The path can wrap onto another line if enough text is inserted, so here it's trimmed

0 commit comments

Comments
 (0)