Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Summary When calling `getBBox` on rect, it will not give correct dimensions as `markers` that are 90% `CGRectZero` so CGRectUnion between some values and (0, 0, 0, 0) will return (0, 0, width, height) ## Test Plan ```tsx import React, { useRef } from 'react'; import { Button, View } from 'react-native'; import { Rect, Svg } from 'react-native-svg'; function App(): React.JSX.Element { const ref1 = useRef<Rect>(null); return ( <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <Svg width={300} height={300}> <Rect x={100} y={100} width={100} height={100} fill="red" opacity={0.5} ref={ref1} /> </Svg> <Button title="Press me" onPress={() => console.log(ref1.current?.getBBox())} /> </View> ); } export default App; ``` Before: return `{"height": 100, "width": 100, "x": 0, "y": 0}` After: return `{"height": 100, "width": 100, "x": 100, "y": 100}` ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | MacOS | ✅ |
- Loading branch information