Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pan restrict only to image view #314

Open
blpraveen opened this issue Dec 12, 2023 · 2 comments
Open

Pan restrict only to image view #314

blpraveen opened this issue Dec 12, 2023 · 2 comments

Comments

@blpraveen
Copy link

Can pan be restricted to only image visible?

@hopperelec
Copy link

hopperelec commented Mar 21, 2024

If I'm understanding your issue correctly, I have the same issue here- I want users to only be able to pan when zoomed in. I tried setting the bounds to

{
  left: svg.width.baseVal.value,
  right: 0,
  top: svg.height.baseVal.value,
  bottom: 0,
}

which does prevent me from panning while zoomed out... but it also prevents me from zooming in.

@a4992214
Copy link

_pan = panzoom(_fullImage
, {bounds: true,
boundsPadding: 0.3,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants