changeset 129:f6abb0dd0f61

RT-16821 - Mac OS: CSS padding not correctly applied on the ScrollPane content
author mickf
date Thu, 08 Dec 2011 14:01:27 +0000
parents 39b77f7b2433
children 2053e699ee06
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java
diffstat 1 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Thu Dec 08 17:47:34 2011 +1000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Thu Dec 08 14:01:27 2011 +0000
@@ -685,27 +685,27 @@
                 ScrollPane control = getSkinnable();
                 Orientation bias = scrollNode.getContentBias();
                 if (bias == null) {
-                    nodeWidth = boundedSize(control.isFitToWidth()? contentWidth : scrollNode.prefWidth(-1),
-                                            scrollNode.minWidth(-1),scrollNode.maxWidth(-1));
-                    nodeHeight = boundedSize(control.isFitToHeight()? contentHeight : scrollNode.prefHeight(-1),
-                                             scrollNode.minHeight(-1), scrollNode.maxHeight(-1));
+                    nodeWidth = snapPosition(boundedSize(control.isFitToWidth()? contentWidth : scrollNode.prefWidth(-1),
+                                                         scrollNode.minWidth(-1),scrollNode.maxWidth(-1)));
+                    nodeHeight = snapPosition(boundedSize(control.isFitToHeight()? contentHeight : scrollNode.prefHeight(-1),
+                                                          scrollNode.minHeight(-1), scrollNode.maxHeight(-1)));
 
                 } else if (bias == Orientation.HORIZONTAL) {
-                    nodeWidth = boundedSize(control.isFitToWidth()? contentWidth : scrollNode.prefWidth(-1),
-                                            scrollNode.minWidth(-1),scrollNode.maxWidth(-1));
-                    nodeHeight = boundedSize(control.isFitToHeight()? contentHeight : scrollNode.prefHeight(nodeWidth),
-                                            scrollNode.minHeight(nodeWidth),scrollNode.maxHeight(nodeWidth));
+                    nodeWidth = snapPosition(boundedSize(control.isFitToWidth()? contentWidth : scrollNode.prefWidth(-1),
+                                                         scrollNode.minWidth(-1),scrollNode.maxWidth(-1)));
+                    nodeHeight = snapPosition(boundedSize(control.isFitToHeight()? contentHeight : scrollNode.prefHeight(nodeWidth),
+                                                          scrollNode.minHeight(nodeWidth),scrollNode.maxHeight(nodeWidth)));
 
                 } else { // bias == VERTICAL
-                    nodeHeight = boundedSize(control.isFitToHeight()? contentHeight : scrollNode.prefHeight(-1),
-                                             scrollNode.minHeight(-1), scrollNode.maxHeight(-1));
-                    nodeWidth = boundedSize(control.isFitToWidth()? contentWidth : scrollNode.prefWidth(nodeHeight),
-                                             scrollNode.minWidth(nodeHeight),scrollNode.maxWidth(nodeHeight));
+                    nodeHeight = snapPosition(boundedSize(control.isFitToHeight()? contentHeight : scrollNode.prefHeight(-1),
+                                                          scrollNode.minHeight(-1), scrollNode.maxHeight(-1)));
+                    nodeWidth = snapPosition(boundedSize(control.isFitToWidth()? contentWidth : scrollNode.prefWidth(nodeHeight),
+                                                         scrollNode.minWidth(nodeHeight),scrollNode.maxWidth(nodeHeight)));
                 }
 
             } else {
-                nodeWidth = scrollNode.getLayoutBounds().getWidth();
-                nodeHeight = scrollNode.getLayoutBounds().getHeight();
+                nodeWidth = snapPosition(scrollNode.getLayoutBounds().getWidth());
+                nodeHeight = snapPosition(scrollNode.getLayoutBounds().getHeight());
             }
         }
     }