diff -r 6ae997057419 modules/graphics/src/main/java/javafx/scene/layout/GridPane.java --- a/modules/graphics/src/main/java/javafx/scene/layout/GridPane.java Thu May 22 17:19:09 2014 +0200 +++ b/modules/graphics/src/main/java/javafx/scene/layout/GridPane.java Tue May 27 08:26:15 2014 +0200 @@ -1205,39 +1205,59 @@ @Override protected double computeMinWidth(double height) { computeGridMetrics(); - final double[] heights = height == -1 ? null : computeHeightsToFit(height).asArray(); + performingLayout = true; + try { + final double[] heights = height == -1 ? null : computeHeightsToFit(height).asArray(); - return snapSpace(getInsets().getLeft()) + - computeMinWidths(heights).computeTotalWithMultiSize() + - snapSpace(getInsets().getRight()); + return snapSpace(getInsets().getLeft()) + + computeMinWidths(heights).computeTotalWithMultiSize() + + snapSpace(getInsets().getRight()); + } finally { + performingLayout = false; + } } @Override protected double computeMinHeight(double width) { computeGridMetrics(); - final double[] widths = width == -1 ? null : computeWidthsToFit(width).asArray(); + performingLayout = true; + try { + final double[] widths = width == -1 ? null : computeWidthsToFit(width).asArray(); - return snapSpace(getInsets().getTop()) + - computeMinHeights(widths).computeTotalWithMultiSize() + - snapSpace(getInsets().getBottom()); + return snapSpace(getInsets().getTop()) + + computeMinHeights(widths).computeTotalWithMultiSize() + + snapSpace(getInsets().getBottom()); + } finally { + performingLayout = false; + } } @Override protected double computePrefWidth(double height) { computeGridMetrics(); - final double[] heights = height == -1 ? null : computeHeightsToFit(height).asArray(); + performingLayout = true; + try { + final double[] heights = height == -1 ? null : computeHeightsToFit(height).asArray(); - return snapSpace(getInsets().getLeft()) + - computePrefWidths(heights).computeTotalWithMultiSize() + - snapSpace(getInsets().getRight()); + return snapSpace(getInsets().getLeft()) + + computePrefWidths(heights).computeTotalWithMultiSize() + + snapSpace(getInsets().getRight()); + } finally { + performingLayout = false; + } } @Override protected double computePrefHeight(double width) { computeGridMetrics(); - final double[] widths = width == -1 ? null : computeWidthsToFit(width).asArray(); + performingLayout = true; + try { + final double[] widths = width == -1 ? null : computeWidthsToFit(width).asArray(); - return snapSpace(getInsets().getTop()) + - computePrefHeights(widths).computeTotalWithMultiSize() + - snapSpace(getInsets().getBottom()); + return snapSpace(getInsets().getTop()) + + computePrefHeights(widths).computeTotalWithMultiSize() + + snapSpace(getInsets().getBottom()); + } finally { + performingLayout = false; + } } private VPos getRowValignment(int rowIndex) {