Skip to content

Commit daf8071

Browse files
committed
Ensure canvas style is set.
1 parent c7ad928 commit daf8071

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/barcodes.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async function _detectWithHspLuminance({barcodeDetector, video}) {
3939
const height = video.videoHeight;
4040
canvas.width = width;
4141
canvas.height = height;
42+
canvas.style = `width: ${width}px; height: ${height}px`;
4243
const ctx = canvas.getContext('2d');
4344
ctx.drawImage(video, 0, 0);
4445
const imageData = ctx.getImageData(0, 0, width, height);

0 commit comments

Comments
 (0)