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

Function _onPanStart

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

Source from the content-addressed store, hash-verified

409 /* Event handlers */
410 // Default handler for the `panstart` event.
411 protected _onPanStart(event: MjolnirGestureEvent): boolean {
412 const pos = this.getCenter(event);
413 if (!this.isPointInBounds(pos, event)) {
414 return false;
415 }
416 let alternateMode = this.isFunctionKeyPressed(event) || event.rightButton || false;
417 if (this.invertPan || this.dragMode === 'pan') {
418 // invertPan is replaced by props.dragMode, keeping for backward compatibility
419 alternateMode = !alternateMode;
420 }
421
422 const newControllerState = this.controllerState[alternateMode ? 'panStart' : 'rotateStart']({
423 pos
424 });
425 this._panMove = alternateMode;
426 this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {isDragging: true});
427 return true;
428 }
429
430 // Default handler for the `panmove` and `panend` event.
431 protected _onPan(event: MjolnirGestureEvent): boolean {

Callers

nothing calls this directly

Calls 2

getCenterMethod · 0.65
updateViewportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…