customized-fabric 1.9.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -18,16 +18,16 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
|
|
18
18
|
objectCaching: false,
|
19
19
|
...constants_1.CURVED_TEXT_OBJECT_ATTRIBUTES.stroke,
|
20
20
|
});
|
21
|
-
const { prefix = "", infix = "
|
21
|
+
const { prefix = "", infix = "", suffix = "" } = text ?? {};
|
22
22
|
this.textObject = new fabric_1.fabric.IText("", {
|
23
23
|
originX: "center",
|
24
24
|
originY: "center",
|
25
25
|
textAlign: "center",
|
26
26
|
objectCaching: false,
|
27
|
-
...text,
|
28
27
|
text: prefix + infix + suffix,
|
29
28
|
fontFamily: "",
|
30
29
|
paintFirst: "stroke",
|
30
|
+
...text,
|
31
31
|
});
|
32
32
|
const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
|
33
33
|
this.set({
|
@@ -17,7 +17,7 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
|
17
17
|
objectCaching: false,
|
18
18
|
...constants_1.TEXT_INPUT_OBJECT_ATTRIBUTES.stroke,
|
19
19
|
});
|
20
|
-
const { prefix = "", infix = "
|
20
|
+
const { prefix = "", infix = "", suffix = "", isAllCapital, lineHeight, charSpacing, } = text ?? {};
|
21
21
|
const fullText = prefix + infix + suffix;
|
22
22
|
this.textObject = new fabric_1.fabric.IText("", {
|
23
23
|
originX: "center",
|
@@ -128,11 +128,11 @@ class ObjectId extends bson_value_1.BSONValue {
|
|
128
128
|
PROCESS_UNIQUE = byte_utils_1.ByteUtils.randomBytes(5);
|
129
129
|
}
|
130
130
|
// 5-byte process unique
|
131
|
-
buffer[4] = PROCESS_UNIQUE[0];
|
132
|
-
buffer[5] = PROCESS_UNIQUE[1];
|
133
|
-
buffer[6] = PROCESS_UNIQUE[2];
|
134
|
-
buffer[7] = PROCESS_UNIQUE[3];
|
135
|
-
buffer[8] = PROCESS_UNIQUE[4];
|
131
|
+
buffer[4] = PROCESS_UNIQUE[0] || 0;
|
132
|
+
buffer[5] = PROCESS_UNIQUE[1] || 0;
|
133
|
+
buffer[6] = PROCESS_UNIQUE[2] || 0;
|
134
|
+
buffer[7] = PROCESS_UNIQUE[3] || 0;
|
135
|
+
buffer[8] = PROCESS_UNIQUE[4] || 0;
|
136
136
|
// 3-byte counter
|
137
137
|
buffer[11] = inc & 0xff;
|
138
138
|
buffer[10] = (inc >> 8) & 0xff;
|
@@ -92,10 +92,10 @@ exports.webByteUtils = {
|
|
92
92
|
for (let i = 0; i < evenLengthHex.length; i += 2) {
|
93
93
|
const firstDigit = evenLengthHex[i];
|
94
94
|
const secondDigit = evenLengthHex[i + 1];
|
95
|
-
if (!HEX_DIGIT.test(firstDigit)) {
|
95
|
+
if (!HEX_DIGIT.test(firstDigit || "")) {
|
96
96
|
break;
|
97
97
|
}
|
98
|
-
if (!HEX_DIGIT.test(secondDigit)) {
|
98
|
+
if (!HEX_DIGIT.test(secondDigit || "")) {
|
99
99
|
break;
|
100
100
|
}
|
101
101
|
const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16);
|