changeset 4934:c1e031aecfea

RT-20698 : Pannable ScrollPane behaves badly when content changes during panning
author mickf
date Thu, 05 Sep 2013 15:27:52 +0100
parents bab22eeb95fd
children d6db14ea1ca7
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Wed Sep 04 13:49:56 2013 +0100
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Thu Sep 05 15:27:52 2013 +0100
@@ -150,9 +150,15 @@
                     (scrollNode.getLayoutBounds().getHeight() != 0.0 && nodeHeight != scrollNode.getLayoutBounds().getHeight())) {
                     getSkinnable().requestLayout();
                 } else {
-                    // otherwise just update scrollbars based on new scrollNode size
-                    updateVerticalSB();
-                    updateHorizontalSB();
+                    /**
+                     * we just need to update scrollbars based on new scrollNode size,
+                     * but we don't do this while dragging, there's no need,
+                     * and it jumps, as dragging updates the scrollbar too.
+                     */
+                    if (!dragDetected) {
+                        updateVerticalSB();
+                        updateHorizontalSB();
+                    }
                 }
             }
         }