Skip to content

Commit 4835330

Browse files
committed
Round detected location coordinates
the unit of location coordinates is pixel. So storing and passing them as integers makes more sense.
1 parent cb4fa1d commit 4835330

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/QrcodeReader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export default {
170170
const heightRatio = this.camera.displayHeight / this.camera.resolutionHeight
171171
172172
return locationArray.map(({ x, y }) => ({
173-
x: x * widthRatio,
174-
y: y * heightRatio,
173+
x: Math.floor(x * widthRatio),
174+
y: Math.floor(y * heightRatio),
175175
}))
176176
},
177177

0 commit comments

Comments
 (0)