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

HTMLElements and SVG elements move in different directions

davidbcoulson opened this issue · comments

Thank you for the amazing library! I have a combination of HTMLElements and SVG elements and I am finding that when I use the zoom both types of elements seem to move away from each other, breaking their original grouping display.

when it loads (HTMLElements are the cards SVG are the arrows)
image

when I zoom out the HTML elements seem to go backward which is great but the SVG elements seem to also move backward and left. This is causing

image

Please let me know if I missed something Here is my code as well to help.

setPanZoom() { var element = document.getElementById(this.workingLevel.toString()) panzoom(element) var everyChild = document.querySelectorAll("svg.leader-line"); everyChild.forEach(x => { panzoom(x) }) }

Looks like something specific to they way this is rendered - can you please share a minimal jsbin/jsfiddle to reproduce?

@anvaka you are right I am using LeaderLine and just found out they are rendered over the page. I will need to hack it some way else thank you for the quick response.