changeset 7933:481f8d61b1cd

RT-38465 [SplitPane] Pixels cut off when GridPane inside SplitPane
author Martin Sladecek <martin.sladecek@oracle.com>
date Mon, 01 Sep 2014 15:23:49 +0200
parents 31335892f770
children 5ee50928c1d6
files modules/graphics/src/main/java/javafx/scene/layout/GridPane.java modules/graphics/src/main/java/javafx/scene/layout/Region.java
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/scene/layout/GridPane.java	Mon Sep 01 11:03:44 2014 +0200
+++ b/modules/graphics/src/main/java/javafx/scene/layout/GridPane.java	Mon Sep 01 15:23:49 2014 +0200
@@ -2045,7 +2045,7 @@
         if (columnPercentTotal > 0) {
             for (int i = 0; i < columnPercentWidth.length; i++) {
                 if (columnPercentWidth[i] >= 0) {
-                    final double size = (contentWidth - hgaps) * (columnPercentWidth[i]/100);
+                    final double size = snapPortion((contentWidth - hgaps) * (columnPercentWidth[i]/100));
                     widths.setSize(i, size);
                 }
             }
--- a/modules/graphics/src/main/java/javafx/scene/layout/Region.java	Mon Sep 01 11:03:44 2014 +0200
+++ b/modules/graphics/src/main/java/javafx/scene/layout/Region.java	Mon Sep 01 15:23:49 2014 +0200
@@ -262,7 +262,7 @@
 
     private static double snapPortion(double value, boolean snapToPixel) {
         if (snapToPixel) {
-            return (value > 0 ? Math.max(1, Math.floor(value)) : Math.min(-1, Math.ceil(value)));
+            return value == 0 ? 0 :(value > 0 ? Math.max(1, Math.floor(value)) : Math.min(-1, Math.ceil(value)));
         }
         return value;
     }