customized-fabric 1.5.7 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -122,7 +122,12 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
122
122
  const canvas = this?.canvas;
123
123
  canvas?.remove(this.uploadedImage);
124
124
  this.uploadedImage = loadedImage;
125
- canvas?.add(this.uploadedImage);
125
+ const index = canvas
126
+ ?.getObjects()
127
+ ?.findIndex((obj) => obj._id == this._id);
128
+ if (index >= 0) {
129
+ canvas.insertAt(loadedImage, index, false);
130
+ }
126
131
  this.fitImage(this.uploadedImage);
127
132
  this.applyImageFilters(this.uploadedImage);
128
133
  canvas?.renderAll();
@@ -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;
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",