Skip to content

Commit 607119c

Browse files
committed
height calculation optimization
height calculation optimization
1 parent 5a8932c commit 607119c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

QRCode.js

Lines changed: 5 additions & 5 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 4.0.6
6+
* Version 4.0.8
77
*
88
* @author [ [email protected] ]
99
*
@@ -1076,10 +1076,6 @@ Drawing.prototype.draw = function(oQRCode) {
10761076
if (_htOption.onRenderingStart) {
10771077
_htOption.onRenderingStart(_htOption)
10781078
}
1079-
if (!_htOption.title && !_htOption.subTitle) {
1080-
_htOption.height -= _htOption.titleHeight;
1081-
_htOption.titleHeight = 0;
1082-
}
10831079

10841080
var nCount = oQRCode.getModuleCount();
10851081
var nWidth = Math.round(_htOption.width / nCount);
@@ -1550,6 +1546,10 @@ function QRCode(canvas, vOption) {
15501546
this._htOption[i] = vOption[i];
15511547
}
15521548
}
1549+
1550+
if (!this._htOption.title && !this._htOption.subTitle) {
1551+
this._htOption.titleHeight = 0;
1552+
}
15531553

15541554
if (this._htOption.version < 0 || this._htOption.version > 40) {
15551555
console.warn("QR Code version '" + this._htOption.version + "' is invalidate, reset to 0")

0 commit comments

Comments
 (0)