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

Function _onPinchStart

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

Source from the content-addressed store, hash-verified

641
642 // Default handler for the `pinchstart` event.
643 protected _onPinchStart(event: MjolnirGestureEvent): boolean {
644 const pos = this.getCenter(event);
645 if (!this.isPointInBounds(pos, event)) {
646 return false;
647 }
648
649 const newControllerState = this.controllerState.zoomStart({pos}).rotateStart({pos});
650 // hack - hammer's `rotation` field doesn't seem to produce the correct angle
651 pinchEventWorkaround._startPinchRotation = event.rotation;
652 pinchEventWorkaround._lastPinchEvent = event;
653 this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {isDragging: true});
654 return true;
655 }
656
657 // Default handler for the `pinchmove` and `pinchend` events.
658 protected _onPinch(event: MjolnirGestureEvent): boolean {

Callers

nothing calls this directly

Calls 4

getCenterMethod · 0.65
rotateStartMethod · 0.65
zoomStartMethod · 0.65
updateViewportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…