changeset 5534:1490b7a04271

RT-33684: Fixed dragging inside ScrollPane. Reviewed-by: Jonathan
author Pavel Safrata <pavel.safrata@oracle.com>
date Fri, 25 Oct 2013 08:32:09 +0100
parents 6769c547912e
children 9312d9a273cd
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Thu Oct 24 23:30:24 2013 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Fri Oct 25 08:32:09 2013 +0100
@@ -85,6 +85,7 @@
 
     private double nodeWidth;
     private double nodeHeight;
+    private boolean nodeSizeInvalid = true;
 
     private double posX;
     private double posY;
@@ -144,7 +145,7 @@
 
     private final InvalidationListener nodeListener = new InvalidationListener() {
         @Override public void invalidated(Observable valueModel) {
-            if (nodeWidth != -1.0 && nodeHeight != -1.0) {
+            if (!nodeSizeInvalid) {
                 /*
                 ** if the new size causes scrollbar visibility to change, then need to relayout
                 ** we also need to correct the thumb size when the scrollnode's size changes 
@@ -265,14 +266,13 @@
         viewContent = new StackPane() {
             @Override public void requestLayout() {
                 // if scrollNode requested layout, will want to recompute
-                nodeWidth = -1;
-                nodeHeight = -1;
+                nodeSizeInvalid = true;
                 updateVerticalSB();
                 updateHorizontalSB();
                 super.requestLayout(); // add as layout root for next layout pass
             }
             @Override protected void layoutChildren() {
-                if (nodeWidth == -1 || nodeHeight == -1) {
+                if (nodeSizeInvalid) {
                     computeScrollNodeSize(getWidth(),getHeight());
                 }
                 if (scrollNode != null && scrollNode.isResizable()) {