mirror of
https://github.com/status-im/react-native-qrcode.git
synced 2025-03-03 11:30:32 +00:00
Fixed rounding issue.
This commit is contained in:
parent
2d6a304321
commit
47f7d9ab70
@ -25,8 +25,8 @@ function renderCanvas(canvas) {
|
||||
cells.forEach(function(row, rowIndex) {
|
||||
row.forEach(function(column, columnIndex) {
|
||||
ctx.fillStyle = column ? bgColor : fgColor;
|
||||
var w = Math.ceil((rowIndex + 1) * cellWidth) - Math.floor(rowIndex * cellWidth);
|
||||
var h = Math.ceil((columnIndex + 1) * cellHeight) - Math.floor(columnIndex * cellHeight);
|
||||
var w = Math.round((rowIndex + 1) * cellWidth) - Math.round(rowIndex * cellWidth);
|
||||
var h = Math.round((columnIndex + 1) * cellHeight) - Math.round(columnIndex * cellHeight);
|
||||
ctx.fillRect(Math.round(rowIndex * cellWidth), Math.round(columnIndex * cellHeight), w, h);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user