Skip to content

Commit

Permalink
Fix BrowserMultiFormatReader doesn't forward hints to internal reader
Browse files Browse the repository at this point in the history
This made changing hints through the BrowserMultiFormatReader impossible, as the underlying MultiFormatReader never receives the new hints.
  • Loading branch information
opl- committed Nov 23, 2024
1 parent 0e68da8 commit 59a3ae1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/browser/BrowserMultiFormatReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ export class BrowserMultiFormatReader extends BrowserCodeReader {

protected readonly reader: MultiFormatReader;

set hints(hints: Map<DecodeHintType, any>) {
this._hints = hints || null;

// Since we don't pass the hints in `decodeBitmap` as other Browser readers do, we need to set them here.
this.reader.setHints(hints);
}

public constructor(
hints: Map<DecodeHintType, any> = null,
timeBetweenScansMillis: number = 500
Expand Down

0 comments on commit 59a3ae1

Please sign in to comment.