customized-fabric 1.3.3 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,6 +112,7 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
112
112
  this.uploadedImage = loadedImage;
113
113
  canvas?.add(this.uploadedImage);
114
114
  this.fitImage(this.uploadedImage);
115
+ this.applyImageFilters(this.uploadedImage);
115
116
  canvas?.renderAll();
116
117
  }
117
118
  return this.uploadedImage;
@@ -174,6 +175,9 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
174
175
  this.canvas?.renderAll();
175
176
  },
176
177
  getMask: async function () {
178
+ if (this.maskObject) {
179
+ return this.maskObject;
180
+ }
177
181
  if (this?.maskUrl) {
178
182
  const maskObject = await (0, utils_1.loadImageFromUrl)(this.maskUrl);
179
183
  maskObject?.set({
@@ -186,10 +190,11 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
186
190
  left: this.left,
187
191
  angle: this.angle,
188
192
  });
193
+ this.maskObject = maskObject;
189
194
  return maskObject;
190
195
  }
191
196
  else {
192
- return new fabric_1.fabric.Rect({
197
+ const maskObject = new fabric_1.fabric.Rect({
193
198
  width: this.width,
194
199
  height: this.height,
195
200
  scaleX: this.scaleX,
@@ -201,6 +206,8 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
201
206
  left: this.left,
202
207
  angle: this.angle,
203
208
  });
209
+ this.maskObject = maskObject;
210
+ return maskObject;
204
211
  }
205
212
  },
206
213
  loadCustomizedImage: async function (image) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",