Skip to content

Commit 236e2d6

Browse files
Jose Peredaaghaisas
Jose Pereda
authored andcommitted
8244421: Wrong scrollbar position on touch enabled devices
Reviewed-by: jvos, aghaisas
1 parent 0385563 commit 236e2d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -2348,8 +2348,13 @@ private void updateViewportDimensions() {
23482348
final double breadthBarLength = isVertical ? snapSizeY(hbar.prefHeight(-1)) : snapSizeX(vbar.prefWidth(-1));
23492349
final double lengthBarBreadth = isVertical ? snapSizeX(vbar.prefWidth(-1)) : snapSizeY(hbar.prefHeight(-1));
23502350

2351-
setViewportBreadth((isVertical ? getWidth() : getHeight()) - (needLengthBar ? lengthBarBreadth : 0));
2352-
setViewportLength((isVertical ? getHeight() : getWidth()) - (needBreadthBar ? breadthBarLength : 0));
2351+
if (!Properties.IS_TOUCH_SUPPORTED) {
2352+
setViewportBreadth((isVertical ? getWidth() : getHeight()) - (needLengthBar ? lengthBarBreadth : 0));
2353+
setViewportLength((isVertical ? getHeight() : getWidth()) - (needBreadthBar ? breadthBarLength : 0));
2354+
} else {
2355+
setViewportBreadth((isVertical ? getWidth() : getHeight()));
2356+
setViewportLength((isVertical ? getHeight() : getWidth()));
2357+
}
23532358
}
23542359

23552360
private void initViewport() {

0 commit comments

Comments
 (0)