Commits

Samir Hadzic committed 4044c0c

Resolving #324 . ResizeToDefault now check if grid's height values have changed for the visible rows.

  • Participants
  • Parent commits 3b4185c

Comments (0)

Files changed (1)

controlsfx/src/main/java/impl/org/controlsfx/spreadsheet/GridViewSkin.java

     
     public void resizeRowsToDefault() {
         rowHeightMap.clear();
+        
+        /**
+         * Wen resizing to default, we need to go through the visible rows in
+         * order to update them directly. Because if the rowHeightMap is empty,
+         * the rows will not detect that maybe the height has changed.
+         */
+        for (GridRow row : (List<GridRow>) getFlow().getCells()) {
+            double newHeight = row.computePrefHeight(-1);
+            if(row.getPrefHeight() != newHeight){
+                row.setPrefHeight(newHeight);
+                row.requestLayout();
+            }
+        }
     }
     /**
      * We want to have extra space when displaying LocalDate because they will