Skip to content

Zooming by pinching on a Macbook trackpad #604

@npielawski

Description

@npielawski

Describe the bug

Hello, and thanks for this nice library!

I am using an orthographic camera with camera controls wheel set to truck. I can pan using two fingers on my Macbook trackpad. If I pinch, it pans in the vertical direction, where I would expect it to Zoom. The touch gesture configuration doesn't alter the behavior.

Pinching inwards pans upwards, while pinching outwards pans downwards, which makes me believe the event is already captured but not linked to zooming.

To Reproduce

Steps to reproduce the behavior:

  1. pinch zoom using trackpad.

Code

<Canvas orthographic camera={{ zoom: 100 }}>
  <CameraControls
    mouseButtons={{
      wheel: ACTION.OFFSET
    }}
  />

  <mesh>
    <boxGeometry args={[1, 1, 1e-5]} />
    <meshStandardMaterial color="orange" />
  </mesh>
</Canvas>

Live example

No response

Expected behavior

It would be great if we could have the same behavior as Firefox's PDF viewer, where one pans with two fingers, while pinching zooms in and out.

Screenshots or Video

No response

Device

Desktop

OS

MacOS

Browser

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions