changeset 2213:ea63f231fad9

Fixed RT-27644:CheckBox text jumps when box size in non-whole number
author "Jasper Potts"
date Fri, 11 Jan 2013 17:38:34 -0800
parents a3d8d58cd558
children c014fe9ac135
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CheckBoxSkin.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CheckBoxSkin.java	Fri Jan 11 14:38:12 2013 -0500
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/CheckBoxSkin.java	Fri Jan 11 17:38:34 2013 -0800
@@ -76,8 +76,8 @@
             final double w, final double h) {
         Insets padding = getSkinnable().getInsets();
 
-        final double boxWidth = box.prefWidth(-1);
-        final double boxHeight = box.prefHeight(-1);
+        final double boxWidth = snapSize(box.prefWidth(-1));
+        final double boxHeight = snapSize(box.prefHeight(-1));
         final double labelWidth = Math.min(getSkinnable().prefWidth(-1) - boxWidth, w - snapSize(boxWidth));
         final double labelHeight = Math.min(getSkinnable().prefHeight(labelWidth), h);
         final double maxHeight = Math.max(boxHeight, labelHeight);
@@ -85,7 +85,7 @@
         final double yOffset = Utils.computeYOffset(h, maxHeight, getSkinnable().getAlignment().getVpos()) + padding.getTop();
 
         layoutLabelInArea(xOffset + boxWidth, yOffset, labelWidth, maxHeight, Pos.CENTER_LEFT);
-        box.resize(snapSize(boxWidth), snapSize(boxHeight));
+        box.resize(boxWidth, boxHeight);
         positionInArea(box, xOffset, yOffset, boxWidth, maxHeight, getBaselineOffset(), HPos.CENTER, VPos.CENTER);
     }
 }