-
Notifications
You must be signed in to change notification settings - Fork 54
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
Panning doesn't work when margins
is set.
#64
Comments
Create a jsfiddle or codepen showing your issue please |
Here you go: https://codepen.io/etipaced/pen/WNQvRGM (I couldn't find the plugin on cdnjs so I just copy-pasted it from my |
margins only work with absolute size of the svg set (for now - maybe i got lazy there). |
I see. I would be willing to spend some time trying to implement this if you can point me in the right direction. |
The source code isnt hard to reason about. Somewhere the math seems to be a bit off. Unfortunately I currently have no ressources left to fix it myself |
Hello @Fuzzyma i have problem with panZoom i used the margins option to limit the pan area to at least 10px of my SVG still visible, but when i move the svg it disappears from the pan area and I don't see it anymore. |
In trying to prevent the SVG from getting dragged/panned out of sight, I'm using the
margins
property like this:I would expect that with a number so low, I would only get 1px (or so, depending on zoom level) of the SVG to remain in view when panning to the extreme edge of the available space.
However, whenever this property is set (using any numerical values), panning simply doesn't work at all. Instead, the SVG zooms with the mouse wheel with the anchor point remaining in the upper-left of the screen. Then it cannot be dragged/panned at all.
(For the record, I've also tried using higher numbers (500 all around), and get the same results.)
This is happening on:
The text was updated successfully, but these errors were encountered: