-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support for getBBox? #89
Comments
Yes.there is a plan for shape elements bounding box calculation. |
OK - thanks for the quick response. In the mean-time I've narrowed my current use-cases down to finding the bounding box of a |
This would make my life a hell lot simpler as I'm currently decoding the |
HI @magicismight, Thanks! |
I've implemented matrix transforms of the Canvas.getClipBounds in GroupShadowNode, you could try exposing and using this. |
I added support for |
You can also use UIManager.measure, closing now. |
Sry, but UIManager does not help. All I get are the X and Y. W and H are undefined :(
and when using
Also it seems typescript forbids it on My unorthodox solution until I find the right answer would be to create a singletone service that keeps a hidden webview. I pass all my svg paths trough that view, I get the results of getBBox and pass them back to whatever script needs them. All wrapped behind a nice I also tried using JS scripts that read the path data and return the bonding box. No reliable results so far. |
Bringing this back from way back -- doesn't look like getBBox was ever implemented. Any chance someone has a good viable workaround? Use case is to trim the empty/white space around the SVG content automatically. |
Hej everyone, any update on this? |
Loving react-native-svg - thanks so much!
I am porting some code to React-Native that I originally wrote for the browser using React.js and SVG. Everything is working great so far, but I've run into a problem - I need to calculate the bounding box of various SVG groups ( elements).
To obtain the bounding box of a element in a browser, it is enough to use a
ref
to get a callback with the mounted element, then invoke the SVG spec'sgetBBox
method on it, e.g.:As far as I can tell there isn't currently any support for
getBBox
in react-native-svg, so ...The text was updated successfully, but these errors were encountered: