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 @Override
protected void onPointerUp( PointerEvent event ) { protected void onPointerUp( PointerEvent event ) {
if (dragging) { if (event == curEvent && dragging) {
dragging = false; dragging = false;
thumb.am = THUMB_ALPHA; thumb.am = THUMB_ALPHA;
curEvent = null; //cancel here so onClick is skipped
} else {
PointF p = content.camera.screenToCamera( (int) event.current.x, (int) event.current.y );
ScrollPane.this.onClick( p.x, p.y );
} }
} }
@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 boolean dragging = false;
private PointF lastPos = new PointF(); private PointF lastPos = new PointF();