changeset 7252:fdcebfd4841f

RT-37421: [TreeView] TreeView layout regression
author jgiles
date Thu, 12 Jun 2014 11:02:31 +1200
parents cf00d4cc7219
children 561b5d8d4971
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java modules/controls/src/test/java/javafx/scene/control/TableViewTest.java
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Wed Jun 11 18:45:36 2014 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Thu Jun 12 11:02:31 2014 +1200
@@ -1296,6 +1296,11 @@
 
         final double viewportLength = getViewportLength();
 
+        // Fix for RT-37421, which was a regression caused by RT-36556
+        if (offset < 0 && !fillEmptyCells) {
+            return false;
+        }
+
         //
         // RT-36507: viewportLength - offset gives the maximum number of
         // additional cells that should ever be able to fit in the viewport if
@@ -2297,10 +2302,6 @@
                 positionCell(cell, getCellPosition(cell) - delta);
             }
 
-            // Now throw away any cells that don't fit
-            // (take one - this resolves RT-36556)
-            cull();
-
             // Fix for RT-32908
             T firstCell = cells.getFirst();
             double layoutY = firstCell == null ? 0 : getCellPosition(firstCell);
@@ -2361,7 +2362,7 @@
             }
         }
 
-        // Now throw away any cells that don't fit (take two)
+        // Now throw away any cells that don't fit
         cull();
 
         // Finally, update the scroll bars
--- a/modules/controls/src/test/java/javafx/scene/control/TableViewTest.java	Wed Jun 11 18:45:36 2014 -0400
+++ b/modules/controls/src/test/java/javafx/scene/control/TableViewTest.java	Thu Jun 12 11:02:31 2014 +1200
@@ -3040,7 +3040,7 @@
         VirtualFlow flow = VirtualFlowTestUtils.getVirtualFlow(tableView);
         flow.adjustPixels(1000 * 24);
 
-        assertEquals(cellCountAtStart + 1, rt36556_instanceCount);
+        assertEquals(cellCountAtStart, rt36556_instanceCount);
 
         sl.dispose();
     }