changeset 1255:c7813fd4d4a0

RT-19738 : Invalid layout behavior with rotates applied
author mickf
date Fri, 08 Jun 2012 18:15:33 +0100
parents abbc696491cb
children e1200e6556ab
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Fri Jun 08 16:04:10 2012 +0100
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Fri Jun 08 18:15:33 2012 +0100
@@ -802,9 +802,7 @@
         updateHorizontalSB();
 
         viewRect.resize(snapSize(contentWidth), snapSize(contentHeight));
-        clipRect.setWidth(snapSize(contentWidth));
-        clipRect.setHeight(snapSize(contentHeight));
-        clipRect.relocate(snapPosition(getInsets().getLeft() - viewRect.getLayoutX()), snapPosition(getInsets().getTop() - viewRect.getLayoutY()));
+        resetClip();
 
         if (vsbvis && hsbvis) {
             corner.setVisible(true);
@@ -936,15 +934,22 @@
     private double updatePosX() {
         viewRect.setLayoutX(snapPosition(getInsets().getLeft() - posX / (hsb.getMax() - hsb.getMin()) * (nodeWidth - contentWidth)));
         getSkinnable().setHvalue(Utils.clamp(getSkinnable().getHmin(), posX, getSkinnable().getHmax()));
+        resetClip();
         return posX;
     }
 
     private double updatePosY() {
         viewRect.setLayoutY(snapPosition(getInsets().getTop() - posY / (vsb.getMax() - vsb.getMin()) * (nodeHeight - contentHeight)));
         getSkinnable().setVvalue(Utils.clamp(getSkinnable().getVmin(), posY, getSkinnable().getVmax()));
+        resetClip();
         return posY;
     }
 
+    private void resetClip() {
+        clipRect.setWidth(snapSize(contentWidth));
+        clipRect.setHeight(snapSize(contentHeight));
+        clipRect.relocate(snapPosition(getInsets().getLeft() - viewRect.getLayoutX()), snapPosition(getInsets().getTop() - viewRect.getLayoutY()));
+    }
 
     Timeline sbTouchTimeline;
     KeyFrame sbTouchKF1;