diff --git a/src/renderer/CanvasRenderer.js b/src/renderer/CanvasRenderer.js index 3ec594c..8f87d8d 100644 --- a/src/renderer/CanvasRenderer.js +++ b/src/renderer/CanvasRenderer.js @@ -46,7 +46,7 @@ var CanvasRenderer = Renderer.extend({ for (i = 0; i < frame.width; i++) { for (j = 0; j < frame.width; j++) { if (frame.buffer[(j * frame.width) + i]) { - context.fillRect((moduleSize * i) + offset, (moduleSize * j) + offset, moduleSize, moduleSize); + context.fillRect(Math.ceil((moduleSize * i) + offset), Math.ceil((moduleSize * j) + offset), Math.ceil(moduleSize), Math.ceil(moduleSize)); } } } diff --git a/src/renderer/Renderer.js b/src/renderer/Renderer.js index a87f613..94d102a 100644 --- a/src/renderer/Renderer.js +++ b/src/renderer/Renderer.js @@ -116,7 +116,7 @@ var Renderer = Nevis.extend(function(qrious, element, enabled) { getModuleSize: function(frame) { var qrious = this.qrious; var padding = qrious.padding || 0; - var pixels = Math.floor((qrious.size - (padding * 2)) / frame.width); + var pixels = (qrious.size - (padding * 2)) / frame.width; return Math.max(1, pixels); }, @@ -143,7 +143,7 @@ var Renderer = Nevis.extend(function(qrious, element, enabled) { } var moduleSize = this.getModuleSize(frame); - var offset = Math.floor((qrious.size - (moduleSize * frame.width)) / 2); + var offset = (qrious.size - (moduleSize * frame.width)) / 2; return Math.max(0, offset); },