modules/controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java
Print this page
@@ -1823,13 +1823,13 @@
}
private void positionCell(T cell, double position) {
if (isVertical()) {
cell.setLayoutX(0);
- cell.setLayoutY(snapSize(position));
+ cell.setLayoutY(snapSizeY(position));
} else {
- cell.setLayoutX(snapSize(position));
+ cell.setLayoutX(snapSizeX(position));
cell.setLayoutY(0);
}
}
private void resizeCellSize(T cell) {
@@ -2214,12 +2214,12 @@
return barVisibilityChanged;
}
private void updateViewportDimensions() {
final boolean isVertical = isVertical();
- final double breadthBarLength = snapSize(isVertical ? hbar.prefHeight(-1) : vbar.prefWidth(-1));
- final double lengthBarBreadth = snapSize(isVertical ? vbar.prefWidth(-1) : hbar.prefHeight(-1));
+ final double breadthBarLength = isVertical ? snapSizeY(hbar.prefHeight(-1)) : snapSizeX(vbar.prefWidth(-1));
+ final double lengthBarBreadth = isVertical ? snapSizeX(vbar.prefWidth(-1)) : snapSizeY(hbar.prefHeight(-1));
setViewportBreadth((isVertical ? getWidth() : getHeight()) - (needLengthBar ? lengthBarBreadth : 0));
setViewportLength((isVertical ? getHeight() : getWidth()) - (needBreadthBar ? breadthBarLength : 0));
}
@@ -2406,12 +2406,12 @@
hbar.resize(hbar.getWidth()-vbar.getWidth(), hbar.getHeight());
vbar.resize(vbar.getWidth(), vbar.getHeight()-hbar.getHeight());
}
}
- clipView.resize(snapSize(isVertical ? viewportBreadth : viewportLength),
- snapSize(isVertical ? viewportLength : viewportBreadth));
+ clipView.resize(snapSizeX(isVertical ? viewportBreadth : viewportLength),
+ snapSizeY(isVertical ? viewportLength : viewportBreadth));
// If the viewportLength becomes large enough that all cells fit
// within the viewport, then we want to update the value to match.
if (getPosition() != lengthBar.getValue()) {
lengthBar.setValue(getPosition());