customized-fabric 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/ClipartObject/index.js +4 -1
- package/lib/ClipartObject/interfaces.d.ts +1 -0
- package/lib/ImagePlaceholderObject/index.js +4 -1
- package/lib/ImagePlaceholderObject/interfaces.d.ts +1 -0
- package/lib/TextInputObject/index.js +4 -1
- package/lib/TextInputObject/interfaces.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +3 -6
- package/package.json +1 -1
@@ -48,9 +48,12 @@ const ClipartClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
|
48
48
|
objectCaching: false,
|
49
49
|
});
|
50
50
|
if (options?.isOriginal) {
|
51
|
-
this.rectObject
|
51
|
+
this.rectObject?.set({ strokeWidth: 0 });
|
52
52
|
}
|
53
53
|
else {
|
54
|
+
if (options?.hideStroke) {
|
55
|
+
this.rectObject?.set({ strokeWidth: 0 });
|
56
|
+
}
|
54
57
|
if (options?.clipartFile || options?.clipartUrl) {
|
55
58
|
this.loadImage(options?.clipartFile ?? options.clipartUrl);
|
56
59
|
}
|
@@ -37,9 +37,12 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
37
37
|
this.loadImage(options?.imageFile);
|
38
38
|
}
|
39
39
|
if (options?.isOriginal) {
|
40
|
-
this.rectObject
|
40
|
+
this.rectObject?.set({ strokeWidth: 0 });
|
41
41
|
}
|
42
42
|
else {
|
43
|
+
if (options?.hideStroke) {
|
44
|
+
this.rectObject?.set({ strokeWidth: 0 });
|
45
|
+
}
|
43
46
|
if (options?.maskFile || options?.maskUrl) {
|
44
47
|
this.loadMask(options?.maskFile ?? options?.maskUrl);
|
45
48
|
}
|
@@ -56,9 +56,12 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
|
56
56
|
width: this.width,
|
57
57
|
});
|
58
58
|
if (options?.isOriginal) {
|
59
|
-
this.rectObject
|
59
|
+
this.rectObject?.set({ strokeWidth: 0 });
|
60
60
|
}
|
61
61
|
else {
|
62
|
+
if (options?.hideStroke) {
|
63
|
+
this.rectObject?.set({ strokeWidth: 0 });
|
64
|
+
}
|
62
65
|
if (options?.fontUrl) {
|
63
66
|
(0, utils_1.loadFontFromUrl)(options?.fontUrl, text?.fontFamily ?? "").then(() => {
|
64
67
|
this.canvas?.renderAll?.();
|
package/lib/utils/index.d.ts
CHANGED
@@ -15,6 +15,7 @@ export declare const lockObject: (object: fabric.Object | any, locked: boolean,
|
|
15
15
|
export declare const lockAllObjects: (canvas: fabric.Canvas, locked: boolean, selectable?: boolean) => void;
|
16
16
|
export declare const getObject: (object: any, options?: {
|
17
17
|
isOriginal?: boolean;
|
18
|
+
hideStroke?: boolean;
|
18
19
|
}) => Clipart | ImagePlaceholder | TextInput | undefined;
|
19
20
|
export declare const asyncGetObject: (object: any, options?: {
|
20
21
|
isOriginal?: boolean;
|
package/lib/utils/index.js
CHANGED
@@ -130,24 +130,21 @@ const getObject = (object, options) => {
|
|
130
130
|
case constants_1.OBJECT_TYPES.textInput: {
|
131
131
|
const textInputObject = new TextInputObject_1.default({
|
132
132
|
...object,
|
133
|
-
|
133
|
+
...options,
|
134
134
|
});
|
135
135
|
return textInputObject;
|
136
136
|
}
|
137
137
|
case constants_1.OBJECT_TYPES.clipart: {
|
138
138
|
const clipartObject = new ClipartObject_1.default({
|
139
139
|
...object,
|
140
|
-
|
140
|
+
...options,
|
141
141
|
});
|
142
|
-
if (object?.clipartUrl) {
|
143
|
-
clipartObject?.loadImage?.(object?.clipartUrl);
|
144
|
-
}
|
145
142
|
return clipartObject;
|
146
143
|
}
|
147
144
|
case constants_1.OBJECT_TYPES.imagePlaceHolder: {
|
148
145
|
const imagePlaceHolderObject = new ImagePlaceholderObject_1.default({
|
149
146
|
...object,
|
150
|
-
|
147
|
+
...options,
|
151
148
|
});
|
152
149
|
return imagePlaceHolderObject;
|
153
150
|
}
|