Skip to content

Commit 335020a

Browse files
committed
autoColor bug fixed.
autoColor bug fixed.
1 parent c433c0a commit 335020a

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

QRCode.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* 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.
55
*
6-
* Version 3.9.1
6+
* Version 3.9.3
77
*
88
* @author [ [email protected] ]
99
*
@@ -1181,12 +1181,23 @@ Drawing.prototype.draw = function(oQRCode) {
11811181

11821182
lColor = "rgba(0,0,0,0)";
11831183
if (row == 6) {
1184-
dColor = _htOption.timing_H || _htOption.timing || _htOption.colorDark;
1184+
// dColor = _htOption.timing_H || _htOption.timing || _htOption.colorDark;
1185+
if (_htOption.autoColor) {
1186+
dColor = _htOption.timing_H || _htOption.timing || _htOption.autoColorDark;
1187+
lColor = _htOption.timing_H || _htOption.timing || _htOption.autoColorLight;
1188+
} else {
1189+
dColor = _htOption.timing_H || _htOption.timing || _htOption.colorDark;
1190+
}
11851191
} else if (col == 6) {
1186-
dColor = _htOption.timing_V || _htOption.timing ||
1187-
_htOption.colorDark;
1192+
// dColor = _htOption.timing_V || _htOption.timing || _htOption.colorDark;
1193+
if (_htOption.autoColor) {
1194+
dColor = _htOption.timing_V || _htOption.timing || _htOption.autoColorDark;
1195+
lColor = _htOption.timing_V || _htOption.timing || _htOption.autoColorLight;
1196+
} else {
1197+
dColor = _htOption.timing_V || _htOption.timing ||
1198+
_htOption.colorDark;
1199+
}
11881200
} else {
1189-
11901201
if (_htOption.autoColor) {
11911202
dColor = _htOption.autoColorDark;
11921203
lColor = _htOption.autoColorLight;
@@ -1220,8 +1231,15 @@ Drawing.prototype.draw = function(oQRCode) {
12201231
nowDotScale = _htOption.dotScaleAO;
12211232
} else if (eye.type == 'AI') {
12221233
nowDotScale = _htOption.dotScaleAI;
1234+
}
1235+
1236+
if (_htOption.backgroundImage && _htOption.autoColor) {
1237+
dColor = ((eye.type == 'AO') ? _htOption.AI : _htOption.AO) ||
1238+
_htOption.autoColorDark;
1239+
lColor = _htOption.autoColorLight;
12231240
} else {
1224-
nowDotScale = 1;
1241+
dColor = ((eye.type == 'AO') ? _htOption.AI : _htOption.AO) ||
1242+
dColor;
12251243
}
12261244

12271245
// _oContext.fillRect(nLeft, _htOption.titleHeight + nTop, nWidth, nHeight);

0 commit comments

Comments
 (0)