react-native-qrcode-scanner icon indicating copy to clipboard operation
react-native-qrcode-scanner copied to clipboard

BarCodeEvent for android has misleading property names in bounds

Open TT191 opened this issue 3 years ago • 1 comments

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

TT191 avatar Feb 11 '22 09:02 TT191

This will help you https://www.youtube.com/watch?v=sE0MEyFA7E4&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=10

BraveEvidence avatar Feb 25 '23 14:02 BraveEvidence