changeset 1427:9b69d1047d82

RT-23281: GridPaneDesignInfo.getCellBounds() breaks after adding a new RowConstraints to a GridPane.
author Kinsley Wong
date Tue, 10 Jul 2012 13:52:24 -0700
parents 1eadff96bc2b
children b26dbc994eec
files javafx-designtime/src/javafx/scene/layout/GridPaneDesignInfo.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-designtime/src/javafx/scene/layout/GridPaneDesignInfo.java	Mon Jul 09 13:16:34 2012 -0700
+++ b/javafx-designtime/src/javafx/scene/layout/GridPaneDesignInfo.java	Tue Jul 10 13:52:24 2012 -0700
@@ -75,8 +75,8 @@
         final double gridPaneWidth = pane.snapSize(pane.getWidth()) - (left + right);
 
         // Compute row height
-        double[] rowHeights = pane.getRowHeights();
-        if (rowHeights == null || rowHeights.length == 0) {
+        double[] rowHeights = pane.getRowHeights();        
+        if (rowHeights == null || rowHeights.length == 0 || rowHeights.length != getRowCount(pane)) {
             rowHeights = new double[] {0};
             rowIndex = 0;
         }
@@ -97,7 +97,7 @@
 
         // Compute column width
         double[] columnWidths = pane.getColumnWidths();
-        if (columnWidths == null || columnWidths.length == 0) {
+        if (columnWidths == null || columnWidths.length == 0 || columnWidths.length != getColumnCount(pane)) {
             columnWidths = new double[] {0};
             columnIndex = 0;
         }