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

Function _onPanMoveEnd

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

Source from the content-addressed store, hash-verified

458 }
459
460 protected _onPanMoveEnd(event: MjolnirGestureEvent): boolean {
461 const {inertia} = this;
462 if (this.dragPan && inertia && event.velocity) {
463 const pos = this.getCenter(event);
464 const endPos: [number, number] = [
465 pos[0] + (event.velocityX * inertia) / 2,
466 pos[1] + (event.velocityY * inertia) / 2
467 ];
468 const newControllerState = this.controllerState.pan({pos: endPos}).panEnd();
469 this.updateViewport(
470 newControllerState,
471 {
472 ...this._getTransitionProps(),
473 transitionDuration: inertia,
474 transitionEasing: INERTIA_EASING
475 },
476 {
477 isDragging: false,
478 isPanning: true
479 }
480 );
481 } else {
482 const newControllerState = this.controllerState.panEnd();
483 this.updateViewport(newControllerState, null, {
484 isDragging: false,
485 isPanning: false
486 });
487 }
488 return true;
489 }
490
491 // Default handler for panning to rotate.
492 // Called by `_onPan` when panning with function key pressed.

Callers

nothing calls this directly

Calls 4

getCenterMethod · 0.65
panEndMethod · 0.65
panMethod · 0.65
updateViewportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…