customized-fabric 1.7.0 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/CurvedTextObject/index.d.ts +1 -0
- package/lib/CurvedTextObject/index.js +5 -1
- package/lib/CurvedTextObject/interfaces.d.ts +2 -1
- package/lib/TextInputObject/index.d.ts +1 -0
- package/lib/TextInputObject/index.js +5 -1
- package/lib/TextInputObject/interfaces.d.ts +2 -1
- package/package.json +1 -1
@@ -27,6 +27,7 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
|
|
27
27
|
...text,
|
28
28
|
text: prefix + infix + suffix,
|
29
29
|
fontFamily: "",
|
30
|
+
paintFirst: "stroke",
|
30
31
|
});
|
31
32
|
const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
|
32
33
|
this.set(group);
|
@@ -110,7 +111,9 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
|
|
110
111
|
},
|
111
112
|
getText: function () {
|
112
113
|
const { prefix = "", infix = "", suffix = "" } = this.textObject;
|
113
|
-
|
114
|
+
const isAllCapital = this.textObject.isAllCapital;
|
115
|
+
const text = prefix + infix + suffix;
|
116
|
+
this.setText(infix?.length > 0 ? (isAllCapital ? text.toUpperCase() : text) : "");
|
114
117
|
},
|
115
118
|
setMaxFontSize: function (fontSize) {
|
116
119
|
this.textObject.set({
|
@@ -224,6 +227,7 @@ const toCurvedTextObject = (object) => {
|
|
224
227
|
curvedWidth: textObject?.curvedWidth,
|
225
228
|
pathSide: textObject?.pathSide,
|
226
229
|
pathStartOffset: textObject?.pathStartOffset,
|
230
|
+
isAllCapital: textObject?.isAllCapital,
|
227
231
|
},
|
228
232
|
};
|
229
233
|
};
|
@@ -10,7 +10,7 @@ export interface ICurvedTextOptions extends fabric.IGroupOptions {
|
|
10
10
|
height?: number;
|
11
11
|
textAlign?: string;
|
12
12
|
fontWeight?: string;
|
13
|
-
text
|
13
|
+
text?: string;
|
14
14
|
fontFamily?: string;
|
15
15
|
maxFontSize: number;
|
16
16
|
stroke?: string;
|
@@ -19,6 +19,7 @@ export interface ICurvedTextOptions extends fabric.IGroupOptions {
|
|
19
19
|
infix?: string;
|
20
20
|
suffix?: string;
|
21
21
|
curvedWidth?: number;
|
22
|
+
isAllCapital?: boolean;
|
22
23
|
};
|
23
24
|
fontUrl?: string;
|
24
25
|
isOriginal?: boolean;
|
@@ -26,6 +26,7 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
|
26
26
|
...text,
|
27
27
|
text: prefix + infix + suffix,
|
28
28
|
fontFamily: "",
|
29
|
+
paintFirst: "stroke",
|
29
30
|
});
|
30
31
|
const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
|
31
32
|
this.set(group);
|
@@ -116,7 +117,9 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
|
116
117
|
},
|
117
118
|
getText: function () {
|
118
119
|
const { prefix = "", infix = "", suffix = "" } = this.textObject;
|
119
|
-
|
120
|
+
const isAllCapital = this.textObject.isAllCapital;
|
121
|
+
const text = prefix + infix + suffix;
|
122
|
+
this.setText(infix?.length > 0 ? (isAllCapital ? text.toUpperCase() : text) : "");
|
120
123
|
},
|
121
124
|
setMaxFontSize: function (fontSize) {
|
122
125
|
this.textObject.set({
|
@@ -204,6 +207,7 @@ const toTextInputObject = (object) => {
|
|
204
207
|
prefix: textObject?.prefix,
|
205
208
|
infix: textObject?.infix,
|
206
209
|
suffix: textObject?.suffix,
|
210
|
+
isAllCapital: textObject?.isAllCapital,
|
207
211
|
},
|
208
212
|
};
|
209
213
|
};
|
@@ -10,7 +10,7 @@ export interface ITextInputOptions extends fabric.IGroupOptions {
|
|
10
10
|
height?: number;
|
11
11
|
textAlign?: string;
|
12
12
|
fontWeight?: string;
|
13
|
-
text
|
13
|
+
text?: string;
|
14
14
|
fontFamily?: string;
|
15
15
|
maxFontSize: number;
|
16
16
|
stroke?: string;
|
@@ -18,6 +18,7 @@ export interface ITextInputOptions extends fabric.IGroupOptions {
|
|
18
18
|
prefix?: string;
|
19
19
|
infix?: string;
|
20
20
|
suffix?: string;
|
21
|
+
isAllCapital?: boolean;
|
21
22
|
};
|
22
23
|
fontUrl?: string;
|
23
24
|
isOriginal?: boolean;
|