customized-fabric 1.3.8 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -233,27 +233,29 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
233
233
|
originX: "center",
|
234
234
|
originY: "center",
|
235
235
|
clipPath: mask,
|
236
|
+
filters: this.imageFilters ?? [],
|
236
237
|
});
|
238
|
+
loadedImage.applyFilters();
|
237
239
|
return loadedImage;
|
238
240
|
}
|
239
241
|
}
|
240
242
|
}
|
241
243
|
},
|
242
|
-
setImageType: function (type
|
244
|
+
setImageType: function (type) {
|
243
245
|
this.imageType = type;
|
244
|
-
this.imageFilters = (0, utils_1.getImageFilters)(type,
|
245
|
-
this.imageObject && this.applyImageFilters(this.imageObject);
|
246
|
+
this.imageFilters = (0, utils_1.getImageFilters)(type, { color: this.imageColor });
|
246
247
|
},
|
247
248
|
setImageColor: function (color) {
|
248
249
|
this.imageColor = color;
|
249
250
|
this.imageFilters = (0, utils_1.getImageFilters)(this.imageType, { color });
|
250
|
-
this.imageObject && this.applyImageFilters(this.imageObject);
|
251
251
|
},
|
252
252
|
applyImageFilters: function (image) {
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
253
|
+
if (image) {
|
254
|
+
const imageFilters = this.imageFilters ?? [];
|
255
|
+
image.filters = imageFilters;
|
256
|
+
image.applyFilters();
|
257
|
+
this.canvas.renderAll();
|
258
|
+
}
|
257
259
|
},
|
258
260
|
});
|
259
261
|
const toImagePlaceholderObject = (imagePlaceholderObject) => {
|