--- old/modules/graphics/src/main/java/javafx/scene/layout/GridPane.java 2016-04-05 16:34:05.000000000 -0700 +++ new/modules/graphics/src/main/java/javafx/scene/layout/GridPane.java 2016-04-05 16:34:05.000000000 -0700 @@ -1204,9 +1204,9 @@ try { final double[] heights = height == -1 ? null : computeHeightsToFit(height).asArray(); - return snapSpace(getInsets().getLeft()) + + return snapSpaceX(getInsets().getLeft()) + computeMinWidths(heights).computeTotalWithMultiSize() + - snapSpace(getInsets().getRight()); + snapSpaceX(getInsets().getRight()); } finally { performingLayout = false; } @@ -1219,9 +1219,9 @@ try { final double[] widths = width == -1 ? null : computeWidthsToFit(width).asArray(); - return snapSpace(getInsets().getTop()) + + return snapSpaceY(getInsets().getTop()) + computeMinHeights(widths).computeTotalWithMultiSize() + - snapSpace(getInsets().getBottom()); + snapSpaceY(getInsets().getBottom()); } finally { performingLayout = false; } @@ -1233,9 +1233,9 @@ try { final double[] heights = height == -1 ? null : computeHeightsToFit(height).asArray(); - return snapSpace(getInsets().getLeft()) + + return snapSpaceX(getInsets().getLeft()) + computePrefWidths(heights).computeTotalWithMultiSize() + - snapSpace(getInsets().getRight()); + snapSpaceX(getInsets().getRight()); } finally { performingLayout = false; } @@ -1247,9 +1247,9 @@ try { final double[] widths = width == -1 ? null : computeWidthsToFit(width).asArray(); - return snapSpace(getInsets().getTop()) + + return snapSpaceY(getInsets().getTop()) + computePrefHeights(widths).computeTotalWithMultiSize() + - snapSpace(getInsets().getBottom()); + snapSpaceY(getInsets().getBottom()); } finally { performingLayout = false; } @@ -1362,14 +1362,14 @@ CompositeSize prefHeights = null; for (int i = 0; i < rowConstr.size(); ++i) { final RowConstraints curConstraint = rowConstr.get(i); - double maxRowHeight = snapSize(curConstraint.getMaxHeight()); + double maxRowHeight = snapSizeY(curConstraint.getMaxHeight()); if (maxRowHeight == USE_PREF_SIZE) { if (prefHeights == null) { prefHeights = computePrefHeights(null); } rowMaxHeight.setPresetSize(i, prefHeights.getSize(i)); } else if (maxRowHeight != USE_COMPUTED_SIZE) { - final double min = snapSize(curConstraint.getMinHeight()); + final double min = snapSizeY(curConstraint.getMinHeight()); if (min >= 0 ) { rowMaxHeight.setPresetSize(i, boundedSize(min, maxRowHeight, maxRowHeight)); } else { @@ -1396,10 +1396,10 @@ final ObservableList rowConstr = getRowConstraints(); for (int i = 0; i < rowConstr.size(); ++i) { final RowConstraints curConstraint = rowConstr.get(i); - double prefRowHeight = snapSize(curConstraint.getPrefHeight()); - final double min = snapSize(curConstraint.getMinHeight()); + double prefRowHeight = snapSizeY(curConstraint.getPrefHeight()); + final double min = snapSizeY(curConstraint.getMinHeight()); if (prefRowHeight != USE_COMPUTED_SIZE) { - final double max = snapSize(curConstraint.getMaxHeight()); + final double max = snapSizeY(curConstraint.getMaxHeight()); if (min >= 0 || max >= 0) { result.setPresetSize(i, boundedSize(min < 0 ? 0 : min, prefRowHeight, @@ -1444,7 +1444,7 @@ final ObservableList rowConstr = getRowConstraints(); CompositeSize prefHeights = null; for (int i = 0; i < rowConstr.size(); ++i) { - double minRowHeight = snapSize(rowConstr.get(i).getMinHeight()); + double minRowHeight = snapSizeY(rowConstr.get(i).getMinHeight()); if (minRowHeight == USE_PREF_SIZE) { if (prefHeights == null) { prefHeights = computePrefHeights(widths); @@ -1491,14 +1491,14 @@ CompositeSize prefWidths = null; for (int i = 0; i < columnConstr.size(); ++i) { final ColumnConstraints curConstraint = columnConstr.get(i); - double maxColumnWidth = snapSize(curConstraint.getMaxWidth()); + double maxColumnWidth = snapSizeX(curConstraint.getMaxWidth()); if (maxColumnWidth == USE_PREF_SIZE) { if (prefWidths == null) { prefWidths = computePrefWidths(null); } columnMaxWidth.setPresetSize(i, prefWidths.getSize(i)); } else if (maxColumnWidth != USE_COMPUTED_SIZE) { - final double min = snapSize(curConstraint.getMinWidth()); + final double min = snapSizeX(curConstraint.getMinWidth()); if (min >= 0) { columnMaxWidth.setPresetSize(i, boundedSize(min, maxColumnWidth, maxColumnWidth)); } else { @@ -1525,10 +1525,10 @@ final ObservableList columnConstr = getColumnConstraints(); for (int i = 0; i < columnConstr.size(); ++i) { final ColumnConstraints curConstraint = columnConstr.get(i); - double prefColumnWidth = snapSize(curConstraint.getPrefWidth()); - final double min = snapSize(curConstraint.getMinWidth()); + double prefColumnWidth = snapSizeX(curConstraint.getPrefWidth()); + final double min = snapSizeX(curConstraint.getMinWidth()); if (prefColumnWidth != USE_COMPUTED_SIZE) { - final double max = snapSize(curConstraint.getMaxWidth()); + final double max = snapSizeX(curConstraint.getMaxWidth()); if (min >= 0 || max >= 0) { result.setPresetSize(i, boundedSize(min < 0 ? 0 : min, prefColumnWidth, @@ -1576,7 +1576,7 @@ final ObservableList columnConstr = getColumnConstraints(); CompositeSize prefWidths = null; for (int i = 0; i < columnConstr.size(); ++i) { - double minColumnWidth = snapSize(columnConstr.get(i).getMinWidth()); + double minColumnWidth = snapSizeX(columnConstr.get(i).getMinWidth()); if (minColumnWidth == USE_PREF_SIZE) { if (prefWidths == null) { prefWidths = computePrefWidths(heights); @@ -1663,12 +1663,12 @@ @Override protected void layoutChildren() { performingLayout = true; try { - final double snaphgap = snapSpace(getHgap()); - final double snapvgap = snapSpace(getVgap()); - final double top = snapSpace(getInsets().getTop()); - final double bottom = snapSpace(getInsets().getBottom()); - final double left = snapSpace(getInsets().getLeft()); - final double right = snapSpace(getInsets().getRight()); + final double snaphgap = snapSpaceX(getHgap()); + final double snapvgap = snapSpaceY(getVgap()); + final double top = snapSpaceY(getInsets().getTop()); + final double bottom = snapSpaceY(getInsets().getBottom()); + final double left = snapSpaceX(getInsets().getLeft()); + final double right = snapSpaceX(getInsets().getRight()); final double width = getWidth(); final double height = getHeight(); @@ -1799,9 +1799,9 @@ private double adjustRowHeights(final CompositeSize heights, double height) { assert(height != -1); - final double snapvgap = snapSpace(getVgap()); - final double top = snapSpace(getInsets().getTop()); - final double bottom = snapSpace(getInsets().getBottom()); + final double snapvgap = snapSpaceY(getVgap()); + final double top = snapSpaceY(getInsets().getTop()); + final double bottom = snapSpaceY(getInsets().getBottom()); final double vgaps = snapvgap * (getNumberOfRows() - 1); final double contentHeight = height - top - bottom; @@ -2004,7 +2004,7 @@ if (portion != 0) { for (Iterator i = adjusting.iterator(); i.hasNext();) { final int index = i.next(); - double limit = snapSpace(limitSize.getProportionalMinOrMaxSize(index, shrinking)) + double limit = snapSpaceY(limitSize.getProportionalMinOrMaxSize(index, shrinking)) - heights.getSize(index); // negative in shrinking case if (shrinking && limit > 0 || !shrinking && limit < 0) { // Limit completely if current size @@ -2040,9 +2040,9 @@ private double adjustColumnWidths(final CompositeSize widths, double width) { assert(width != -1); - final double snaphgap = snapSpace(getHgap()); - final double left = snapSpace(getInsets().getLeft()); - final double right = snapSpace(getInsets().getRight()); + final double snaphgap = snapSpaceX(getHgap()); + final double left = snapSpaceX(getInsets().getLeft()); + final double right = snapSpaceX(getInsets().getRight()); final double hgaps = snaphgap * (getNumberOfColumns() - 1); final double contentWidth = width - left - right; @@ -2248,7 +2248,7 @@ if (portion != 0) { for (Iterator i = adjusting.iterator(); i.hasNext();) { final int index = i.next(); - double limit = snapSpace(limitSize.getProportionalMinOrMaxSize(index, shrinking)) + double limit = snapSpaceX(limitSize.getProportionalMinOrMaxSize(index, shrinking)) - widths.getSize(index); // negative in shrinking case if (shrinking && limit > 0 || !shrinking && limit < 0) { // Limit completely if current size @@ -2289,8 +2289,8 @@ if (!gridLines.getChildren().isEmpty()) { gridLines.getChildren().clear(); } - double hgap = snapSpace(getHgap()); - double vgap = snapSpace(getVgap()); + double hgap = snapSpaceX(getHgap()); + double vgap = snapSpaceY(getVgap()); // create vertical lines double linex = x; @@ -2341,12 +2341,12 @@ private CompositeSize createCompositeRows(double initSize) { return new CompositeSize(getNumberOfRows(), rowPercentHeight, rowPercentTotal, - snapSpace(getVgap()), initSize); + snapSpaceY(getVgap()), initSize); } private CompositeSize createCompositeColumns(double initSize) { return new CompositeSize(getNumberOfColumns(), columnPercentWidth, columnPercentTotal, - snapSpace(getHgap()), initSize); + snapSpaceX(getHgap()), initSize); } private int getNodeRowEndConvertRemaining(Node child) { @@ -2740,14 +2740,14 @@ */ @Deprecated // SB-dependency: RT-33381 has been filed to track this public final Bounds impl_getCellBounds(int columnIndex, int rowIndex) { - final double snaphgap = this.snapSpace(this.getHgap()); - final double snapvgap = this.snapSpace(this.getVgap()); - final double top = this.snapSpace(this.getInsets().getTop()); - final double right = this.snapSpace(this.getInsets().getRight()); - final double bottom = this.snapSpace(this.getInsets().getBottom()); - final double left = this.snapSpace(this.getInsets().getLeft()); - final double gridPaneHeight = this.snapSize(this.getHeight()) - (top + bottom); - final double gridPaneWidth = this.snapSize(this.getWidth()) - (left + right); + final double snaphgap = this.snapSpaceX(this.getHgap()); + final double snapvgap = this.snapSpaceY(this.getVgap()); + final double top = this.snapSpaceY(this.getInsets().getTop()); + final double right = this.snapSpaceX(this.getInsets().getRight()); + final double bottom = this.snapSpaceY(this.getInsets().getBottom()); + final double left = this.snapSpaceX(this.getInsets().getLeft()); + final double gridPaneHeight = this.snapSizeY(this.getHeight()) - (top + bottom); + final double gridPaneWidth = this.snapSizeX(this.getWidth()) - (left + right); // Compute grid. Result contains two double arrays, first for columns, second for rows double[] columnWidths;