soccer-jersey-fork 1.0.90 → 1.0.91
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.
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { Svg } from "@svgdotjs/svg.js";
|
|
7
7
|
import { StyleDirection } from "../types";
|
|
8
8
|
export declare const drawStriped: (page: Svg, primaryColor: string, secondaryColor: string, direction: StyleDirection, thickness?: "thin" | "thick" | "normal") => import("@svgdotjs/svg.js").Pattern;
|
|
9
|
-
export declare const drawBigCheckered: (page: Svg, primaryColor: string, secondaryColor: string, direction?: StyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
10
9
|
export declare const drawCheckered: (page: Svg, primaryColor: string, secondaryColor: string, size: "sm" | "lg", direction?: StyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
11
10
|
export declare const drawDiamonds: (page: Svg, primaryColor: string, secondaryColor: string) => import("@svgdotjs/svg.js").Pattern;
|
|
12
11
|
export declare const drawTwoColors: (page: Svg, primaryColor: string, secondaryColor: string, bandStyle: StyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
package/lib/patterns/patterns.js
CHANGED
|
@@ -90,23 +90,6 @@ const drawStripedNormal = (page, primaryColor, secondaryColor, direction) => {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
export const drawBigCheckered = (page, primaryColor, secondaryColor, direction) => {
|
|
94
|
-
const draw = () => {
|
|
95
|
-
return page.pattern(100, 100, function (add) {
|
|
96
|
-
add.rect(100, 100).fill(primaryColor);
|
|
97
|
-
add.rect(50, 50).fill(secondaryColor);
|
|
98
|
-
add.rect(50, 50).fill(secondaryColor).move(50, 50);
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
switch (direction) {
|
|
102
|
-
case "diagonalLeft": {
|
|
103
|
-
return draw().rotate(45);
|
|
104
|
-
}
|
|
105
|
-
default: {
|
|
106
|
-
return draw();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
93
|
export const drawCheckered = (page, primaryColor, secondaryColor, size, direction) => {
|
|
111
94
|
const tileSize = size === "sm" ? 20 : 100;
|
|
112
95
|
const patternSize = tileSize / 2;
|
|
@@ -209,7 +192,7 @@ export const drawSingleBandThin = (page, primaryColor, secondaryColor, bandStyle
|
|
|
209
192
|
const drawVertical = (x) => {
|
|
210
193
|
return page.pattern(90, 100, function (add) {
|
|
211
194
|
add.rect(90, 100).fill(primaryColor);
|
|
212
|
-
add.rect(
|
|
195
|
+
add.rect(10, 100).fill(secondaryColor).move(x, 0);
|
|
213
196
|
});
|
|
214
197
|
};
|
|
215
198
|
switch (bandStyle) {
|
|
@@ -222,7 +205,7 @@ export const drawSingleBandThin = (page, primaryColor, secondaryColor, bandStyle
|
|
|
222
205
|
case "horizontal":
|
|
223
206
|
return page.pattern(100, 90, function (add) {
|
|
224
207
|
add.rect(100, 90).fill(primaryColor);
|
|
225
|
-
add.rect(100,
|
|
208
|
+
add.rect(100, 10).fill(secondaryColor).move(0, 35);
|
|
226
209
|
});
|
|
227
210
|
case "vertical":
|
|
228
211
|
return drawVertical(48);
|
package/lib/types/index.d.ts
CHANGED
|
@@ -179,8 +179,8 @@ export default function drawSoccerJersey({ shirtColor = "plain", shirtStyle, shi
|
|
|
179
179
|
const dimens = draftShirtTextElem.bbox();
|
|
180
180
|
let backgroundShapeElement;
|
|
181
181
|
switch (backgroundShape) {
|
|
182
|
-
case "
|
|
183
|
-
backgroundShapeElement = page.
|
|
182
|
+
case "ellipse": {
|
|
183
|
+
backgroundShapeElement = page.ellipse(dimens.width + 8, dimens.height + 8);
|
|
184
184
|
break;
|
|
185
185
|
}
|
|
186
186
|
default: {
|