Skip to content

Commit ec4d43a

Browse files
authored
Merge pull request #3 from manhcuongdtbk/fix-always-auto-color
Fix auto color always be changed back to true
2 parents a5988c7 + a46ec93 commit ec4d43a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,11 +1099,10 @@ Drawing.prototype.draw = function(oQRCode) {
10991099
this._canvas.width = this._htOption.width + this._htOption.quietZone * 2;
11001100
this._canvas.height = this._htOption.height + this._htOption.quietZone * 2;
11011101

1102-
this._htOption.autoColor=true;
1103-
11041102
var autoColorDark="rgba(0, 0, 0, .6)";
11051103
var autoColorLight="rgba(255, 255, 255, .7)";
11061104
var notAutoColorLight="rgba(0,0,0,0)";
1105+
11071106
// JPG
11081107
if(_htOption.format=='JPG' ){
11091108

@@ -1212,8 +1211,7 @@ Drawing.prototype.draw = function(oQRCode) {
12121211
_oContext.strokeStyle = bIsDark ? autoColorDark : autoColorLight;
12131212
_oContext.fillStyle = bIsDark ? autoColorDark : autoColorLight;
12141213
} else {
1215-
// _oContext.strokeStyle = bIsDark ? _htOption.colorDark : notAutoColorLight;
1216-
_oContext.fillStyle = bIsDark ? _htOption.colorDark : notAutoColorLight;
1214+
_oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
12171215
_oContext.strokeStyle = _oContext.fillStyle;
12181216
}
12191217
_oContext.fillRect(nLeft + nWidth * (1 - nowDotScale) / 2, _htOption.titleHeight + nTop + nHeight * (1 -

0 commit comments

Comments
 (0)