Skip to content

zoomWithWheel zooms exponentially but pinch zooming doesn't #683

Open
@Voultapher

Description

@Voultapher

Describe the bug

When using zoomWithWheel the zoom behavior is intuitive and making progress seems natural. Looking at the zoom scale values across different zoom levels, they increment and decrement exponential. However pinch zooming behaves differently where at largish zoom values, 10+, making any progress is painfully slow.

Your environment

  • Panzoom 4.6.0
  • Chromium 134 on desktop and Safari 18.3 on IpadOS

Expected behavior

Both should behave consistently out of the box and there should be an option to customize the behavior.

Actual behavior

Inconsistent zoom expericne.

Steps to reproduce

Load SVG, and set maxScale to a high value like 40 and then try pinch zooming in all the way in and compare that to a desktop scroll wheel experience.

This issue seems to have been discussed in the past here #63 and then fixed with the exponential option, but that doesn't exist anymore.

EDIT: Further investigation suggests linear zooming in terms of incremented wheel zoom scale values. One wheel rotation goes from e.g. scale 20 -> 22, which scale set to 0.1 or from 2 -> 2.2, it's not adding 0.1 at each step. But pinch zooming seems to increment by the absolute step value, regardless of the scale.

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