customized-fabric 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -175,6 +175,9 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
|
175
175
|
this.canvas?.renderAll();
|
|
176
176
|
},
|
|
177
177
|
getMask: async function () {
|
|
178
|
+
if (this.maskObject) {
|
|
179
|
+
return this.maskObject;
|
|
180
|
+
}
|
|
178
181
|
if (this?.maskUrl) {
|
|
179
182
|
const maskObject = await (0, utils_1.loadImageFromUrl)(this.maskUrl);
|
|
180
183
|
maskObject?.set({
|
|
@@ -187,10 +190,11 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
|
187
190
|
left: this.left,
|
|
188
191
|
angle: this.angle,
|
|
189
192
|
});
|
|
193
|
+
this.maskObject = maskObject;
|
|
190
194
|
return maskObject;
|
|
191
195
|
}
|
|
192
196
|
else {
|
|
193
|
-
|
|
197
|
+
const maskObject = new fabric_1.fabric.Rect({
|
|
194
198
|
width: this.width,
|
|
195
199
|
height: this.height,
|
|
196
200
|
scaleX: this.scaleX,
|
|
@@ -202,6 +206,8 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
|
202
206
|
left: this.left,
|
|
203
207
|
angle: this.angle,
|
|
204
208
|
});
|
|
209
|
+
this.maskObject = maskObject;
|
|
210
|
+
return maskObject;
|
|
205
211
|
}
|
|
206
212
|
},
|
|
207
213
|
loadCustomizedImage: async function (image) {
|