v3.3.0: adjusted ScrollPane to use PointerArea's onClick logic

This commit is contained in:
Evan Debenham
2025-10-08 13:30:35 -04:00
parent 3dfd4c8109
commit 8a5e05364a

View File

@@ -180,19 +180,19 @@ public class ScrollPane extends Component {
@Override
protected void onPointerUp( PointerEvent event ) {
if (dragging) {
if (event == curEvent && dragging) {
dragging = false;
thumb.am = THUMB_ALPHA;
} else {
PointF p = content.camera.screenToCamera( (int) event.current.x, (int) event.current.y );
ScrollPane.this.onClick( p.x, p.y );
curEvent = null; //cancel here so onClick is skipped
}
}
@Override
protected void onClick(PointerEvent event) {
PointF p = content.camera.screenToCamera((int) event.current.x, (int) event.current.y);
ScrollPane.this.onClick(p.x, p.y);
}
private boolean dragging = false;
private PointF lastPos = new PointF();