cqsmart-qrcode
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -38,3 +38,3 @@ 'use strict' | ||
logoHeight: React.PropTypes.number, | ||
logoStyle: React.PropTypes.object||React.PropTypes.string, | ||
logoBorder: React.PropTypes.object||React.PropTypes.string, | ||
}, | ||
@@ -114,5 +114,3 @@ | ||
image.src = this.props.logo; | ||
if(this.props.logoStyle){ | ||
image.style.border=this.props.logoStyle.border | ||
} | ||
image.onload = function() { | ||
@@ -126,5 +124,10 @@ var dwidth = self.props.logoWidth || size * 0.2; | ||
ctx.drawImage(image, dx, dy, dwidth, dheight); | ||
ctx.lineWidth = 1; | ||
ctx.strokeStyle = '#108ee9'; | ||
ctx.strokeRect(dx,dy,dwidth,dheight) | ||
if(this.props.logoBorder){ | ||
const border= this.props.logoBorder | ||
image.style.border=this.props.logoStyle.border | ||
ctx.lineWidth = border.lineWidth; | ||
ctx.strokeStyle =border.color; | ||
ctx.strokeRect(dx,dy,dwidth,dheight) | ||
} | ||
} | ||
@@ -131,0 +134,0 @@ } |
{ | ||
"name": "cqsmart-qrcode", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "React component to generate QRCode with logo", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
20663
126