customized-fabric 1.4.4 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -151,6 +151,8 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
151
151
|
skewX,
|
152
152
|
skewY,
|
153
153
|
opacity,
|
154
|
+
type: this.imageType,
|
155
|
+
color: this.imageColor,
|
154
156
|
};
|
155
157
|
}
|
156
158
|
else {
|
@@ -225,7 +227,7 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
225
227
|
const loadedImage = await (0, utils_1.loadImageFromUrl)(url);
|
226
228
|
if (loadedImage) {
|
227
229
|
const mask = await this.getMask();
|
228
|
-
const { top, left, scaleX, width, angle } = data;
|
230
|
+
const { top, left, scaleX, width, angle, color, type } = data;
|
229
231
|
const ratioWidth = (width * scaleX) / (clipPath.width * clipPath.scaleX);
|
230
232
|
const ratioPosition = this.width / clipPath.width;
|
231
233
|
loadedImage.scaleToWidth(ratioWidth * this.width);
|
@@ -236,7 +238,9 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
236
238
|
originX: "center",
|
237
239
|
originY: "center",
|
238
240
|
clipPath: mask,
|
239
|
-
filters:
|
241
|
+
filters: color && type
|
242
|
+
? (0, utils_1.getImageFilters)(type, { color })
|
243
|
+
: this.imageFilters,
|
240
244
|
});
|
241
245
|
loadedImage.applyFilters();
|
242
246
|
return loadedImage;
|