Fixed gray lines in between blocks.
The distance between the highest point the next point can be and the lowest point the current can be is calculated and then it fills from the closest integer to the current point. Conflicts: src/jquery.qrcode.js
This commit is contained in:
parent
77aa3c30cb
commit
386c0b4353
1 changed files with 4 additions and 2 deletions
|
|
@ -34,8 +34,10 @@
|
|||
// draw in the canvas
|
||||
for( var row = 0; row < qrcode.getModuleCount(); row++ ){
|
||||
for( var col = 0; col < qrcode.getModuleCount(); col++ ){
|
||||
ctx.fillStyle = qrcode.isDark(row, col) ? "#000000" : "#ffffff";
|
||||
ctx.fillRect( col*tileW, row*tileH, tileW, tileH );
|
||||
ctx.fillStyle = qrcode.isDark(row, col) ? options.foreground : options.background;
|
||||
var w = (Math.ceil((col+1)*tileW) - Math.floor(col*tileW));
|
||||
var h = (Math.ceil((row+1)*tileW) - Math.floor(row*tileW));
|
||||
ctx.fillRect(Math.round(col*tileW),Math.round(row*tileH), w, h);
|
||||
}
|
||||
}
|
||||
// return just built canvas
|
||||
|
|
|
|||
Loading…
Reference in a new issue