Skip to content

Commit da1b2ef

Browse files
Fix paragraph graphic node width calculation (#1125)
1 parent 8bec00c commit da1b2ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ protected void layoutChildren() {
262262

263263
double getGraphicPrefWidth() {
264264
return graphic.filter( Node::isManaged )
265-
.map( n -> n.prefWidth(-1) )
265+
.map( n -> Math.min(Math.max(n.prefWidth(-1), n.minWidth(-1)), n.maxWidth(-1)) )
266266
.getOrElse( 0.0 );
267267
}
268268

0 commit comments

Comments
 (0)