From 59a3ae1596633403c6258f3293c64e74b33f5663 Mon Sep 17 00:00:00 2001 From: opl <4833621+opl@users.noreply.github.com> Date: Sat, 23 Nov 2024 11:49:21 +0100 Subject: [PATCH] Fix BrowserMultiFormatReader doesn't forward hints to internal reader This made changing hints through the BrowserMultiFormatReader impossible, as the underlying MultiFormatReader never receives the new hints. --- src/browser/BrowserMultiFormatReader.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/browser/BrowserMultiFormatReader.ts b/src/browser/BrowserMultiFormatReader.ts index a983f14d..3d07406c 100644 --- a/src/browser/BrowserMultiFormatReader.ts +++ b/src/browser/BrowserMultiFormatReader.ts @@ -8,6 +8,13 @@ export class BrowserMultiFormatReader extends BrowserCodeReader { protected readonly reader: MultiFormatReader; + set hints(hints: Map) { + 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 = null, timeBetweenScansMillis: number = 500