customized-fabric 1.5.8 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +2 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +8 -3
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
package/lib/constants.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.OBJECT_TYPES = void 0;
|
3
|
+
exports.MAX_TEXTURE_SIZE = exports.OBJECT_TYPES = void 0;
|
4
4
|
const constants_1 = require("./ClipartObject/constants");
|
5
5
|
const constants_2 = require("./CurvedTextObject/constants");
|
6
6
|
const constants_3 = require("./ImagePlaceholderObject/constants");
|
@@ -14,3 +14,4 @@ exports.OBJECT_TYPES = {
|
|
14
14
|
activeSelection: "activeSelection",
|
15
15
|
layoutGroup: constants_4.LAYOUT_GROUP_OBJECT_ATTRIBUTES.type,
|
16
16
|
};
|
17
|
+
exports.MAX_TEXTURE_SIZE = 20000;
|
package/lib/utils/index.d.ts
CHANGED
@@ -20,5 +20,5 @@ export declare const getObject: (object: any, options?: {
|
|
20
20
|
}) => Clipart | ImagePlaceholder | CurvedText | TextInput | undefined;
|
21
21
|
export declare const asyncGetObject: (object: any, options?: {
|
22
22
|
isOriginal?: boolean;
|
23
|
-
}) => Promise<fabric.Image | Clipart | ImagePlaceholder | TextInput | undefined>;
|
23
|
+
}) => Promise<fabric.Image | Clipart | ImagePlaceholder | CurvedText | TextInput | undefined>;
|
24
24
|
export default fabric;
|
package/lib/utils/index.js
CHANGED
@@ -196,6 +196,13 @@ const asyncGetObject = async (object, options) => {
|
|
196
196
|
}
|
197
197
|
return imagePlaceHolderObject;
|
198
198
|
}
|
199
|
+
case constants_1.OBJECT_TYPES.curvedText: {
|
200
|
+
const curvedTextObject = new CurvedTextObject_1.default({
|
201
|
+
...object,
|
202
|
+
isOriginal: options?.isOriginal,
|
203
|
+
});
|
204
|
+
return curvedTextObject;
|
205
|
+
}
|
199
206
|
default:
|
200
207
|
return;
|
201
208
|
}
|
@@ -210,9 +217,7 @@ fabric_1.fabric.Group.prototype.originX = "center";
|
|
210
217
|
fabric_1.fabric.Group.prototype.originY = "center";
|
211
218
|
fabric_1.fabric.ActiveSelection.prototype.originX = "center";
|
212
219
|
fabric_1.fabric.ActiveSelection.prototype.originY = "center";
|
213
|
-
|
214
|
-
fabric_1.fabric.textureSize = fabric_1.fabric.maxTextureSize;
|
215
|
-
}
|
220
|
+
fabric_1.fabric.textureSize = constants_1.MAX_TEXTURE_SIZE;
|
216
221
|
fabric_1.fabric.Object.prototype.toObject = (function (toObject) {
|
217
222
|
return function () {
|
218
223
|
switch (this.type) {
|