@liquid-js/qr-code-styling 3.0.0-0 → 3.0.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1266,16 +1266,6 @@ class QRSVG {
|
|
|
1266
1266
|
const dot = new QRDot({ svg: this._element, type: options.dotsOptions.type, document: this._document });
|
|
1267
1267
|
[this._dotsMask, this._dotsMaskGroup] = this._createMask("mask-dot-color");
|
|
1268
1268
|
this._defs.appendChild(this._dotsMask);
|
|
1269
|
-
this._createColor({
|
|
1270
|
-
options: options.dotsOptions?.gradient,
|
|
1271
|
-
color: options.dotsOptions.color,
|
|
1272
|
-
additionalRotation: 0,
|
|
1273
|
-
x: 0,
|
|
1274
|
-
y: 0,
|
|
1275
|
-
height: options.height,
|
|
1276
|
-
width: options.width,
|
|
1277
|
-
name: "dot-color"
|
|
1278
|
-
});
|
|
1279
1269
|
for (let i = 0; i < count; i++) {
|
|
1280
1270
|
for (let j = 0; j < count; j++) {
|
|
1281
1271
|
if (filter && !filter(i, j)) {
|
|
@@ -1296,12 +1286,18 @@ class QRSVG {
|
|
|
1296
1286
|
}
|
|
1297
1287
|
}
|
|
1298
1288
|
}
|
|
1289
|
+
let colorX = xBeginning;
|
|
1290
|
+
let colorY = yBeginning;
|
|
1291
|
+
let colorCount = count;
|
|
1299
1292
|
if (options.shape === ShapeType.circle) {
|
|
1300
1293
|
const margin = (this._options.backgroundOptions && this._options.backgroundOptions.margin) || 0;
|
|
1301
1294
|
const additionalDots = Math.floor((minSize / dotSize - count - 2 * margin) / 2);
|
|
1302
1295
|
const fakeCount = count + additionalDots * 2;
|
|
1303
1296
|
const xFakeBeginning = xBeginning - additionalDots * dotSize;
|
|
1304
1297
|
const yFakeBeginning = yBeginning - additionalDots * dotSize;
|
|
1298
|
+
colorX = xFakeBeginning;
|
|
1299
|
+
colorY = yFakeBeginning;
|
|
1300
|
+
colorCount = count + additionalDots * 2;
|
|
1305
1301
|
const fakeMatrix = [];
|
|
1306
1302
|
const center = Math.floor(fakeCount / 2);
|
|
1307
1303
|
for (let i = 0; i < fakeCount; i++) {
|
|
@@ -1337,6 +1333,16 @@ class QRSVG {
|
|
|
1337
1333
|
}
|
|
1338
1334
|
}
|
|
1339
1335
|
}
|
|
1336
|
+
this._createColor({
|
|
1337
|
+
options: options.dotsOptions?.gradient,
|
|
1338
|
+
color: options.dotsOptions.color,
|
|
1339
|
+
additionalRotation: 0,
|
|
1340
|
+
x: colorX,
|
|
1341
|
+
y: colorY,
|
|
1342
|
+
height: colorCount * dotSize,
|
|
1343
|
+
width: colorCount * dotSize,
|
|
1344
|
+
name: "dot-color"
|
|
1345
|
+
});
|
|
1340
1346
|
}
|
|
1341
1347
|
drawCorners() {
|
|
1342
1348
|
if (!this._qr) {
|