changeset 1810:8d346510b927

Additional fix for RT-25049 to avoid label truncation.
author leifs
date Thu, 11 Oct 2012 12:48:20 -0700
parents 32ed56155a53
children ef37b66b00b0
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java	Thu Oct 11 10:10:05 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java	Thu Oct 11 12:48:20 2012 -0700
@@ -234,20 +234,16 @@
 
     @Override protected double computePrefWidth(double height) {
         final Insets padding = getInsets();
-        final Insets arrowButtonPadding = arrowButton.getInsets();
         return padding.getLeft()
                 + label.prefWidth(height)
-                + arrowButtonPadding.getLeft()
-                + arrow.prefWidth(height)
-                + arrowButtonPadding.getRight()
+                + snapSize(arrowButton.prefWidth(height))
                 + padding.getRight();
     }
 
     @Override protected double computePrefHeight(double width) {
         final Insets padding = getInsets();
-        final Insets arrowButtonPadding = arrowButton.getInsets();
         return padding.getTop()
-                + Math.max(label.prefHeight(width), arrowButtonPadding.getTop() + arrow.prefHeight(-1) + arrowButtonPadding.getBottom())
+                + Math.max(label.prefHeight(width), snapSize(arrowButton.prefHeight(-1)))
                 + padding.getBottom();
     }
 
@@ -260,8 +256,8 @@
     }
 
     @Override protected void layoutChildren(final double x, final double y,
-            final double w, final double h) {
-        final double arrowButtonWidth = Math.ceil(arrowButton.prefWidth(-1));
+                                            final double w, final double h) {
+        final double arrowButtonWidth = snapSize(arrowButton.prefWidth(-1));
         label.resizeRelocate(x, y, w - arrowButtonWidth, h);
         arrowButton.resizeRelocate(x+(w-arrowButtonWidth), y, arrowButtonWidth, h);
     }