Skip to content

Commit ae419d7

Browse files
Alexander Scherbatiykevinrushforth
authored andcommitted
8282100: Missed top/left bouncing for ScrollPane on Raspberry Pi with Touchscreen
Reviewed-by: aghaisas
1 parent 263db3d commit ae419d7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,10 @@ private double updatePosX() {
11721172
final ScrollPane sp = getSkinnable();
11731173
double x = isReverseNodeOrientation() ? (hsb.getMax() - (posX - hsb.getMin())) : posX;
11741174
double hsbRange = hsb.getMax() - hsb.getMin();
1175-
double minX = hsbRange > 0 ? Math.min(-x / hsbRange * (nodeWidth - contentWidth), 0) : 0;
1175+
double minX = hsbRange > 0 ? -x / hsbRange * (nodeWidth - contentWidth) : 0;
1176+
if (!Properties.IS_TOUCH_SUPPORTED) {
1177+
minX = Math.min(minX, 0);
1178+
}
11761179
viewContent.setLayoutX(snapPositionX(minX));
11771180
if (!sp.hvalueProperty().isBound()) sp.setHvalue(Utils.clamp(sp.getHmin(), posX, sp.getHmax()));
11781181
return posX;
@@ -1181,7 +1184,10 @@ private double updatePosX() {
11811184
private double updatePosY() {
11821185
final ScrollPane sp = getSkinnable();
11831186
double vsbRange = vsb.getMax() - vsb.getMin();
1184-
double minY = vsbRange > 0 ? Math.min(-posY / vsbRange * (nodeHeight - contentHeight), 0) : 0;
1187+
double minY = vsbRange > 0 ? -posY / vsbRange * (nodeHeight - contentHeight) : 0;
1188+
if (!Properties.IS_TOUCH_SUPPORTED) {
1189+
minY = Math.min(minY, 0);
1190+
}
11851191
viewContent.setLayoutY(snapPositionY(minY));
11861192
if (!sp.vvalueProperty().isBound()) sp.setVvalue(Utils.clamp(sp.getVmin(), posY, sp.getVmax()));
11871193
return posY;

0 commit comments

Comments
 (0)