Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: apple bounding box (CGPathGetPathBoundingBox) (#2177)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect --> # Summary As per the spec, bbox should not include any transformations, including scaling. It should also not include any control points. This fixes getBBox to give correct results matching Google Chrome, Firefox as per the spec. * What issues does the pull request solve? Please tag them so that they will get automatically closed once the PR is merged * What is the feature? (if applicable) Bug fix. * How did you implement the solution? Like this, see. * What areas of the library does it impact? getBBox API. ## Test Plan I build some stuff that works with SVG, the results on web were inconsistent, and digging down I realise it was a react-native-svg. Some fun fact, there was a surprisingly similar bug related to very confusing named (CGPathGetBoundingBox vs CGPathGetPathBoundingBox) APIs in Firefox some years ago as well. https://bugzilla.mozilla.org/show_bug.cgi?id=1369904 ### What's required for testing (prerequisites)? ### What are the steps to reproduce (after prerequisites)? ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | 🔘# | | Web | 🔘 *| * Depends on the host platform. But works fine in major browsers. # will create a follow up PR. Currently getBBox on Android doesn't account for scaling properly. ## Checklist <!-- Check completed item, when applicable, via: [X] --> - [x] I have tested this on a device and a simulator - [x] I added documentation in `README.md` - [x] I updated the typed files (typescript) - [x] I added a test for the API in the `__tests__` folder Co-authored-by: Omeid Matten <[email protected]>
- Loading branch information