Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/QRCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function renderCanvas(canvas) {
canvas.height = size;
canvas.style.left = (window.innerWidth - size) / 2 + 'px';
if(window.innerHeight > size) canvas.style.top = (window.innerHeight - size) / 2 + 'px';
ctx.fillRect(0, 0, size, size);
var cells = this.cells;
var cellWidth = this.size / cells.length;
var cellHeight = this.size / cells.length;
Expand All @@ -30,6 +29,7 @@ function renderCanvas(canvas) {
var nTop = rowIndex * cellHeight;
ctx.fillStyle = ctx.strokeStyle = column ? bgColor : fgColor;
ctx.lineWidth = 1;
ctx.clearRect(nLeft, nTop, cellWidth, cellHeight);
ctx.fillRect(nLeft, nTop, cellWidth, cellHeight);
ctx.strokeRect(
Math.floor(nLeft) + 0.5,
Expand Down Expand Up @@ -104,7 +104,7 @@ var QRCode = createReactClass({
render={renderCanvas}
onLoad={this.props.onLoad}
onLoadEnd={this.props.onLoadEnd}
style={{height: size, width: size}}
style={{height: size, width: size, backgroundColor: 'transparent' }}
/>
</View>
);
Expand Down