Skip to content
Permalink
Browse files
8282100: Missed top/left bouncing for ScrollPane on Raspberry Pi with…
… Touchscreen

Reviewed-by: aghaisas
  • Loading branch information
Alexander Scherbatiy authored and kevinrushforth committed Mar 7, 2022
1 parent 263db3d commit ae419d7780bef540b95d3376817d708e6508ecca
Showing 1 changed file with 8 additions and 2 deletions.
@@ -1172,7 +1172,10 @@ private double updatePosX() {
final ScrollPane sp = getSkinnable();
double x = isReverseNodeOrientation() ? (hsb.getMax() - (posX - hsb.getMin())) : posX;
double hsbRange = hsb.getMax() - hsb.getMin();
double minX = hsbRange > 0 ? Math.min(-x / hsbRange * (nodeWidth - contentWidth), 0) : 0;
double minX = hsbRange > 0 ? -x / hsbRange * (nodeWidth - contentWidth) : 0;
if (!Properties.IS_TOUCH_SUPPORTED) {
minX = Math.min(minX, 0);
}
viewContent.setLayoutX(snapPositionX(minX));
if (!sp.hvalueProperty().isBound()) sp.setHvalue(Utils.clamp(sp.getHmin(), posX, sp.getHmax()));
return posX;
@@ -1181,7 +1184,10 @@ private double updatePosX() {
private double updatePosY() {
final ScrollPane sp = getSkinnable();
double vsbRange = vsb.getMax() - vsb.getMin();
double minY = vsbRange > 0 ? Math.min(-posY / vsbRange * (nodeHeight - contentHeight), 0) : 0;
double minY = vsbRange > 0 ? -posY / vsbRange * (nodeHeight - contentHeight) : 0;
if (!Properties.IS_TOUCH_SUPPORTED) {
minY = Math.min(minY, 0);
}
viewContent.setLayoutY(snapPositionY(minY));
if (!sp.vvalueProperty().isBound()) sp.setVvalue(Utils.clamp(sp.getVmin(), posY, sp.getVmax()));
return posY;

1 comment on commit ae419d7

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on ae419d7 Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.