3
3
*
4
4
* React Native QRCode generation component. Can generate standard QRCode image or base64 image data url text. Cross-browser QRCode generator for pure javascript. Support Dot style, Logo, Background image, Colorful, Title etc. settings. support binary mode.
5
5
*
6
- * Version 4.0.5
6
+ * Version 4.0.6
7
7
*
8
8
9
9
*
@@ -1080,7 +1080,7 @@ Drawing.prototype.draw = function(oQRCode) {
1080
1080
_htOption . height -= _htOption . titleHeight ;
1081
1081
_htOption . titleHeight = 0 ;
1082
1082
}
1083
-
1083
+
1084
1084
var nCount = oQRCode . getModuleCount ( ) ;
1085
1085
var nWidth = Math . round ( _htOption . width / nCount ) ;
1086
1086
var nHeight = Math . round ( ( _htOption . height - _htOption . titleHeight ) / nCount ) ;
@@ -1093,10 +1093,10 @@ Drawing.prototype.draw = function(oQRCode) {
1093
1093
1094
1094
_htOption . quietZone = Math . round ( _htOption . quietZone ) ;
1095
1095
1096
- this . _htOption . width = nWidth * nCount ;
1097
- this . _htOption . height = nHeight * nCount + _htOption . titleHeight ;
1098
- this . _canvas . height = this . _htOption . height + this . _htOption . quietZone * 2 ;
1099
- this . _canvas . width = this . _htOption . width + this . _htOption . quietZone * 2 ;
1096
+ _htOption . width = nWidth * nCount ;
1097
+ _htOption . height = nHeight * nCount + _htOption . titleHeight ;
1098
+ this . _canvas . height = _htOption . height + _htOption . quietZone * 2 ;
1099
+ this . _canvas . width = _htOption . width + _htOption . quietZone * 2 ;
1100
1100
1101
1101
var autoColorDark = _htOption . autoColorDark ;
1102
1102
var autoColorLight = _htOption . autoColorLight ;
@@ -1110,7 +1110,7 @@ Drawing.prototype.draw = function(oQRCode) {
1110
1110
1111
1111
var _oContext = this . _oContext ;
1112
1112
_oContext . lineWidth = 0 ;
1113
- _oContext . fillStyle = this . _htOption . colorLight ;
1113
+ _oContext . fillStyle = _htOption . colorLight ;
1114
1114
_oContext . fillRect ( 0 , 0 , this . _canvas . width , this . _canvas . height ) ;
1115
1115
1116
1116
@@ -1322,7 +1322,6 @@ Drawing.prototype.draw = function(oQRCode) {
1322
1322
1323
1323
if ( _htOption . logo ) {
1324
1324
var logoImg = new CanvasImage ( t . _canvas ) ;
1325
- var _this = this ;
1326
1325
1327
1326
function generateLogoImg ( img ) {
1328
1327
var imgContainerW = Math . round ( _htOption . width / 3.5 ) ;
@@ -1399,12 +1398,12 @@ Drawing.prototype.draw = function(oQRCode) {
1399
1398
_oContext . drawImage ( img , imgContainerX + ( imgContainerW - imgW ) / 2 , imgContainerY +
1400
1399
( imgContainerH - imgH ) / 2 , imgW , imgH ) ;
1401
1400
1402
- _this . _bIsPainted = true ;
1401
+ t . _bIsPainted = true ;
1403
1402
1404
1403
drawQuietZoneColor ( ) ;
1405
1404
if ( _htOption . onRenderingEnd ) {
1406
1405
_htOption . onRenderingEnd ( _htOption , function ( ) {
1407
- return _this . _canvas . toDataURL ( ) ;
1406
+ return t . _canvas . toDataURL ( ) ;
1408
1407
} ) ;
1409
1408
}
1410
1409
}
@@ -1419,11 +1418,11 @@ Drawing.prototype.draw = function(oQRCode) {
1419
1418
logoImg . src = _htOption . logo ;
1420
1419
} else {
1421
1420
drawQuietZoneColor ( ) ;
1422
- this . _bIsPainted = true ;
1421
+ t . _bIsPainted = true ;
1423
1422
1424
1423
if ( _htOption . onRenderingEnd ) {
1425
1424
_htOption . onRenderingEnd ( _htOption , function ( ) {
1426
- return _this . _canvas . toDataURL ( ) ;
1425
+ return t . _canvas . toDataURL ( ) ;
1427
1426
} ) ;
1428
1427
}
1429
1428
}
0 commit comments