modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java
Print this page
rev 8393 : RT-39035: [TableView] TableView vertical mouse wheel scrolling does not go to the bottom (screen at a time or fast wheel setting)
*** 1234,1243 ****
--- 1234,1248 ----
// offset is our indication of whether we can lay out additional
// cells. If the offset is ever < 0, except in the case of the very
// first cell, then we must quit.
T cell = null;
+ // special case for the position == 1.0, skip adding last invisible cell
+ if (index == cellCount && offset == getViewportLength()) {
+ index--;
+ first = false;
+ }
while (index >= 0 && (offset > 0 || first)) {
cell = getAvailableCell(index);
setCellIndex(cell, index);
resizeCellSize(cell); // resize must be after config
cells.addFirst(cell);
*** 1700,1710 ****
for (int i = cells.size() - 1; i >= 0; i--) {
T cell = cells.get(i);
double cellSize = getCellLength(cell);
double cellStart = getCellPosition(cell);
double cellEnd = cellStart + cellSize;
! if (cellStart > viewportLength || cellEnd < 0) {
addToPile(cells.remove(i));
}
}
}
--- 1705,1715 ----
for (int i = cells.size() - 1; i >= 0; i--) {
T cell = cells.get(i);
double cellSize = getCellLength(cell);
double cellStart = getCellPosition(cell);
double cellEnd = cellStart + cellSize;
! if (cellStart >= viewportLength || cellEnd < 0) {
addToPile(cells.remove(i));
}
}
}
*** 2337,2346 ****
--- 2342,2353 ----
}
layoutY += getCellLength(cell);
}
// end of fix for RT-32908
+ cull();
+ firstCell = cells.getFirst();
// Add any necessary leading cells
if (firstCell != null) {
int firstIndex = getCellIndex(firstCell);
double prevIndexSize = getCellLength(firstIndex - 1);
*** 2378,2387 ****
--- 2385,2399 ----
for (int i = 0; i < cells.size(); i++) {
T cell = cells.get(i);
positionCell(cell, getCellPosition(cell) + emptySize);
}
setPosition(1.0f);
+ // fill the leading empty space
+ firstCell = cells.getFirst();
+ int firstIndex = getCellIndex(firstCell);
+ double prevIndexSize = getCellLength(firstIndex - 1);
+ addLeadingCells(firstIndex - 1, getCellPosition(firstCell) - prevIndexSize);
}
}
}
// Now throw away any cells that don't fit