(event: MjolnirGestureEvent)
| 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…