@liquid-js/qr-code-styling 2.2.1 → 2.2.2
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.
- package/LICENSE +21 -21
- package/lib/figures/cornerDot/QRCornerDot.d.ts +0 -1
- package/lib/figures/cornerSquare/QRCornerSquare.d.ts +1 -2
- package/lib/qr-code-styling-node.js +4 -53
- package/lib/qr-code-styling-node.js.map +1 -1
- package/lib/qr-code-styling.js +1 -1
- package/lib/qr-code-styling.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 Denys Kozak
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Denys Kozak
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -16,7 +16,6 @@ export declare class QRCornerDot {
|
|
|
16
16
|
_basicHeart(args: BasicFigureDrawArgs): void;
|
|
17
17
|
_basicRounded(args: BasicFigureDrawArgs): void;
|
|
18
18
|
_basicClassy(args: BasicFigureDrawArgs): void;
|
|
19
|
-
_basicOutpoint(args: BasicFigureDrawArgs): void;
|
|
20
19
|
_basicInpoint(args: BasicFigureDrawArgs): void;
|
|
21
20
|
_drawDot({ x, y, size, rotation }: DrawArgs): void;
|
|
22
21
|
_drawSquare({ x, y, size, rotation }: DrawArgs): void;
|
|
@@ -15,12 +15,11 @@ export declare class QRCornerSquare {
|
|
|
15
15
|
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
16
|
_basicExtraRounded(args: BasicFigureDrawArgs): void;
|
|
17
17
|
_basicClassy(args: BasicFigureDrawArgs): void;
|
|
18
|
-
_basicOutpoint(args: BasicFigureDrawArgs): void;
|
|
19
18
|
_basicInpoint(args: BasicFigureDrawArgs): void;
|
|
20
19
|
_drawDot({ x, y, size, rotation }: DrawArgs): void;
|
|
21
20
|
_drawSquare({ x, y, size, rotation }: DrawArgs): void;
|
|
22
21
|
_drawExtraRounded({ x, y, size, rotation }: DrawArgs): void;
|
|
23
22
|
_drawClassy({ x, y, size, rotation }: DrawArgs): void;
|
|
24
|
-
_drawOutpoint({ x, y, size, rotation }: DrawArgs): void;
|
|
25
23
|
_drawInpoint({ x, y, size, rotation }: DrawArgs): void;
|
|
24
|
+
_drawOutpoint({ x, y, size, rotation }: DrawArgs): void;
|
|
26
25
|
}
|
|
@@ -428,26 +428,6 @@ class QRCornerDot {
|
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
|
-
_basicOutpoint(args) {
|
|
432
|
-
const { size, x, y } = args;
|
|
433
|
-
const dotSize = size;
|
|
434
|
-
this._rotateFigure({
|
|
435
|
-
...args,
|
|
436
|
-
draw: () => {
|
|
437
|
-
this._element = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
438
|
-
this._element.setAttribute("clip-rule", "evenodd");
|
|
439
|
-
this._element.setAttribute("d", `M ${x} ${y + dotSize / 2}` +
|
|
440
|
-
`v ${dotSize / 4}` +
|
|
441
|
-
`a ${dotSize / 4}, ${dotSize / 4} 0 0 0 ${dotSize / 4}, ${dotSize / 4}` +
|
|
442
|
-
`h ${dotSize / 2}` +
|
|
443
|
-
`a ${dotSize / 4}, ${dotSize / 4} 0 0 0 ${dotSize / 4}, ${-dotSize / 4}` +
|
|
444
|
-
`v ${-dotSize / 2}` +
|
|
445
|
-
`a ${dotSize / 4}, ${dotSize / 4} 0 0 0 ${-dotSize / 4}, ${-dotSize / 4}` +
|
|
446
|
-
`h ${(-dotSize / 4) * 3}` +
|
|
447
|
-
`z`);
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
431
|
_basicInpoint(args) {
|
|
452
432
|
const { size, x, y } = args;
|
|
453
433
|
const dotSize = size;
|
|
@@ -493,7 +473,7 @@ class QRCornerDot {
|
|
|
493
473
|
this._basicInpoint({ x, y, size, rotation });
|
|
494
474
|
}
|
|
495
475
|
_drawOutpoint({ x, y, size, rotation }) {
|
|
496
|
-
this.
|
|
476
|
+
this._basicInpoint({ x, y, size, rotation: (rotation || 0) + Math.PI });
|
|
497
477
|
}
|
|
498
478
|
}
|
|
499
479
|
|
|
@@ -630,35 +610,6 @@ class QRCornerSquare {
|
|
|
630
610
|
}
|
|
631
611
|
});
|
|
632
612
|
}
|
|
633
|
-
_basicOutpoint(args) {
|
|
634
|
-
const { size, x, y } = args;
|
|
635
|
-
const dotSize = size / 7;
|
|
636
|
-
this._rotateFigure({
|
|
637
|
-
...args,
|
|
638
|
-
draw: () => {
|
|
639
|
-
this._element = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
640
|
-
this._element.setAttribute("clip-rule", "evenodd");
|
|
641
|
-
this._element.setAttribute("d", `M ${x} ${y + 2.5 * dotSize}` +
|
|
642
|
-
`v ${2 * dotSize}` +
|
|
643
|
-
`a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${dotSize * 2.5} ${dotSize * 2.5}` +
|
|
644
|
-
`h ${2 * dotSize}` +
|
|
645
|
-
`a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${dotSize * 2.5} ${-dotSize * 2.5}` +
|
|
646
|
-
`v ${-2 * dotSize}` +
|
|
647
|
-
`a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${-dotSize * 2.5} ${-dotSize * 2.5}` +
|
|
648
|
-
`h ${-2 * dotSize}` +
|
|
649
|
-
`a ${dotSize} ${2.5 * dotSize}, 0, 0, 0, ${-dotSize * 2.5} ${dotSize * 2.5}` +
|
|
650
|
-
`M ${x + 2.5 * dotSize} ${y + dotSize}` +
|
|
651
|
-
`h ${2 * dotSize}` +
|
|
652
|
-
`a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${dotSize * 1.5} ${dotSize * 1.5}` +
|
|
653
|
-
`v ${2 * dotSize}` +
|
|
654
|
-
`a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${-dotSize * 1.5} ${dotSize * 1.5}` +
|
|
655
|
-
`h ${-2 * dotSize}` +
|
|
656
|
-
`a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${-dotSize * 1.5} ${-dotSize * 1.5}` +
|
|
657
|
-
`v ${-2 * dotSize}` +
|
|
658
|
-
`l 0 ${-dotSize * 1.5}`);
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
613
|
_basicInpoint(args) {
|
|
663
614
|
const { size, x, y } = args;
|
|
664
615
|
const dotSize = size / 7;
|
|
@@ -698,12 +649,12 @@ class QRCornerSquare {
|
|
|
698
649
|
_drawClassy({ x, y, size, rotation }) {
|
|
699
650
|
this._basicClassy({ x, y, size, rotation });
|
|
700
651
|
}
|
|
701
|
-
_drawOutpoint({ x, y, size, rotation }) {
|
|
702
|
-
this._basicOutpoint({ x, y, size, rotation });
|
|
703
|
-
}
|
|
704
652
|
_drawInpoint({ x, y, size, rotation }) {
|
|
705
653
|
this._basicInpoint({ x, y, size, rotation });
|
|
706
654
|
}
|
|
655
|
+
_drawOutpoint({ x, y, size, rotation }) {
|
|
656
|
+
this._basicInpoint({ x, y, size, rotation: (rotation || 0) + Math.PI });
|
|
657
|
+
}
|
|
707
658
|
}
|
|
708
659
|
|
|
709
660
|
class QRDot {
|