# HG changeset patch # Parent 9c5dc17e8c467f5d11efb6ec3157035883486369 RT-21495: use content pref height/width if ScrollPane's pref height/width is USE_COMPUTED_SIZE diff -r 9c5dc17e8c46 -r e62ebade1361 modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java Wed Jan 29 16:06:46 2014 -0500 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java Wed Jan 29 16:13:01 2014 -0500 @@ -743,6 +743,9 @@ double vsbWidth = sp.getVbarPolicy() == ScrollBarPolicy.ALWAYS? vsb.prefWidth(-1) : 0; return (sp.getPrefViewportWidth() + vsbWidth + snappedLeftInset() + snappedRightInset()); } + else if (sp.getPrefWidth() == ScrollPane.USE_COMPUTED_SIZE && sp.getContent() != null) { + return sp.getContent().prefWidth(height); + } else { return DEFAULT_PREF_SIZE; } @@ -755,6 +758,9 @@ double hsbHeight = sp.getHbarPolicy() == ScrollBarPolicy.ALWAYS? hsb.prefHeight(-1) : 0; return (sp.getPrefViewportHeight() + hsbHeight + snappedTopInset() + snappedBottomInset()); } + else if (sp.getPrefHeight() == ScrollPane.USE_COMPUTED_SIZE && sp.getContent() != null) { + return sp.getContent().prefHeight(width); + } else { return DEFAULT_PREF_SIZE; }