ariutta/svg-pan-zoom — pull request #59 by vprus (2014-08-12 09:34:27+00:00)
Title: Correctly fit/center SVG with negative offsets.

In my case, I have SVG with elements at negative y. I found that
the 'center' option actually makes them invisible - the element
on the top is the one with zero y coordinate.

It appears the code now uses getBoundingClientRect, not getBBox.
Here's what I get on my example:

boundingClientRect: ClientRect
height: 667.8125
top: 55.1875
...

bbox: SVGRect
height: 667.8125
y: -17.8125

That 'top' is both ignored right now, and is in HTML coordinates -
the top of SVG is 72px, 72-17.8125 is exactly 55.1875. I presume
it's possible to use getBoundingClientRect, computing 'y' using
top as well as svg.offsetTop, but using getBBox() seems more
straightforward.