changeset 3447:2d98a575a794

RT-29997: ListView/ListCell: setWrapText/setMaxWidth has no effect RT-23839: Lists,Trees and Tables do not work with wrapped text
author jgiles
date Tue, 30 Apr 2013 14:41:31 +1200
parents d38ece4804d2
children e86efcabcb1f
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Apr 30 10:47:36 2013 +1200
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Apr 30 14:41:31 2013 +1200
@@ -1669,10 +1669,13 @@
 
     private void resizeCellSize(T cell) {
         if (cell == null) return;
-        if (isVertical())
-            cell.resize(cell.getWidth(), cell.prefHeight(-1));
-        else
-            cell.resize(cell.prefWidth(-1), cell.getHeight());
+        if (isVertical()) {
+            double width = cell.getWidth();
+            cell.resize(width, cell.prefHeight(width));
+        } else {
+            double height = cell.getHeight();
+            cell.resize(cell.prefWidth(height), cell.getHeight());
+        }
     }
 
     private void setCellIndex(T cell, int index) {