MCPcopy
hub / github.com/visgl/deck.gl / _onMultiPanEnd

Function _onMultiPanEnd

modules/core/src/controllers/controller.ts:610–640  ·  view source on GitHub ↗
(event: MjolnirGestureEvent)

Source from the content-addressed store, hash-verified

608 }
609
610 protected _onMultiPanEnd(event: MjolnirGestureEvent): boolean {
611 if (!this.isDragging()) {
612 return false;
613 }
614 const {inertia} = this;
615 if (this.touchRotate && inertia && event.velocityY) {
616 const pos = this.getCenter(event);
617 const endPos: [number, number] = [pos[0], (pos[1] += (event.velocityY * inertia) / 2)];
618 const newControllerState = this.controllerState.rotate({pos: endPos});
619 this.updateViewport(
620 newControllerState,
621 {
622 ...this._getTransitionProps(),
623 transitionDuration: inertia,
624 transitionEasing: INERTIA_EASING
625 },
626 {
627 isDragging: false,
628 isRotating: true
629 }
630 );
631 this.blockEvents(inertia);
632 } else {
633 const newControllerState = this.controllerState.rotateEnd();
634 this.updateViewport(newControllerState, null, {
635 isDragging: false,
636 isRotating: false
637 });
638 }
639 return true;
640 }
641
642 // Default handler for the `pinchstart` event.
643 protected _onPinchStart(event: MjolnirGestureEvent): boolean {

Callers

nothing calls this directly

Calls 4

getCenterMethod · 0.65
rotateMethod · 0.65
rotateEndMethod · 0.65
updateViewportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…