customized-fabric 1.3.3 → 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.
@@ -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
|
-
|
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) {
|