anvaka / panzoom

Universal pan and zoom library (DOM, SVG, Custom)

Home Page:https://anvaka.github.io/panzoom/demo/attach-via-script.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pan restrict only to image view

blpraveen opened this issue · comments

Can pan be restricted to only image visible?

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.