changeset 5718:3efcb0d079ca

RT-34219: fixed TextArea's scrollbar after deleting its content. Reviewed-by: Jonathan.
author Pavel Safrata <pavel.safrata@oracle.com>
date Fri, 15 Nov 2013 07:48:18 +0000
parents 373de73b0e35
children c634c5440bba
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Thu Nov 14 14:58:24 2013 -0800
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Fri Nov 15 07:48:18 2013 +0000
@@ -271,9 +271,12 @@
             @Override public void requestLayout() {
                 // if scrollNode requested layout, will want to recompute
                 nodeSizeInvalid = true;
-                updateVerticalSB();
-                updateHorizontalSB();
+
                 super.requestLayout(); // add as layout root for next layout pass
+
+                // Need to layout the ScrollPane as well in case scrollbars
+                // appeared or disappeared.
+                ScrollPaneSkin.this.getSkinnable().requestLayout();
             }
             @Override protected void layoutChildren() {
                 if (nodeSizeInvalid) {
@@ -930,6 +933,7 @@
                 nodeWidth = snapSize(scrollNode.getLayoutBounds().getWidth());
                 nodeHeight = snapSize(scrollNode.getLayoutBounds().getHeight());
             }
+            nodeSizeInvalid = false;
         }
     }