-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add viewBox=(... ) to svg element #43
Comments
Interesting! So I guess we want the view box to match the content in the viewer? We would need to watch for content changes so it could update as needed. Also I think this makes the most sense when there's a single image in the viewer... otherwise the images could be spread apart and I guess the view box would have to be the smallest rectangle that contains them all. For that reason it might make sense for this to be an option. Anyway, seems like a good idea! Thank you for posting this. If you're interested in developing this feature, I can help point you in the right direction. Otherwise perhaps someone else will take an interest. |
Yeah I am interesting in trying to develop it myself. Already tried setting a viewBox using this._svg.setAttribute("viewBox", "0 0 " + this._viewer.viewport._containerInnerSize.x + " " + this._viewer.viewport._containerInnerSize.y); but that did not work |
Cool. I think the bounds you want is |
I don't understand how to use homeBounds for this. |
I believe |
I am wondering if it is posssible to add a
viewBox=(0 0 width height)
attribute to the svg element?The reason beeing, I am having issues with svg images that have elements that extend outside of the image (as in they have negative coordinates, or extend beyond the image itself).
The external svg file that I load has the viewbox applied, but it obvously gets removed when I add the external file to the overlay node.
See here for an example:
The text was updated successfully, but these errors were encountered: