Skip to content

Erratic zooming when target element is much larger than its container #672

Open
@Jaszuro

Description

@Jaszuro

Describe the bug

If the target element is much larger than its container, then when zoomed out, zooming with pinching messes up the whole "scene" as the focal point is wrong and zoom speed gets significantly increased. Check out this JSFiddle. Pinch-zoom out to see the whole green element inside the blue container, then release, then pinch-zoom again. The focal point seems to be somewhere in the top-left area instead of the correct position.

Your environment

  • Version of panzoom: 4.5.1
  • Browser and browser version: Chrome, 130.0.6723.92 (Official Build) (64-bit)

Expected behavior

Pinch-zooming should behave as intuition tells us.

Actual behavior

Pinch-zooming goes haywire, the target element goes out of the container, zooming "speeds up" significantly.

Steps to reproduce

Check out the JSFiddle above.

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