react-native-qrcode-scanner
react-native-qrcode-scanner copied to clipboard
BarCodeEvent for android has misleading property names in bounds
What's happening?
onRead returns a function with BarCodeReadEvent
onRead={ (e: BarCodeReadEvent) => {} }
in Android, e.bounds is an object with type
{
width: number, // width of component
height: number, // height of component
origin: Array<Point<string>> // points of scanned qr code corners on the component
}
However, the width / height and Points({x: string, y: string}) are not what they seems to mean In portrait app, width means width in landscape, height means height in landscape, x and y means x and y in landscape
so if you need to set a frame to catch the qrcode, you need to remember to use correct properties for calculation
I haven't test landscape app so I don't know if there are any differences
How can it be reproduced?
Build details?
1.5.4
This will help you https://www.youtube.com/watch?v=sE0MEyFA7E4&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=10