Skip to content

Commit

Permalink
8244421: Wrong scrollbar position on touch enabled devices
Browse files Browse the repository at this point in the history
Reviewed-by: jvos, aghaisas
  • Loading branch information
Jose Pereda authored and aghaisas committed May 8, 2020
1 parent 0385563 commit 236e2d6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2348,8 +2348,13 @@ private void updateViewportDimensions() {
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));
if (!Properties.IS_TOUCH_SUPPORTED) {
setViewportBreadth((isVertical ? getWidth() : getHeight()) - (needLengthBar ? lengthBarBreadth : 0));
setViewportLength((isVertical ? getHeight() : getWidth()) - (needBreadthBar ? breadthBarLength : 0));
} else {
setViewportBreadth((isVertical ? getWidth() : getHeight()));
setViewportLength((isVertical ? getHeight() : getWidth()));
}
}

private void initViewport() {
Expand Down

0 comments on commit 236e2d6

Please sign in to comment.