customized-fabric 1.4.5 → 1.4.7
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.
@@ -151,8 +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
|
+
type: this.imageType,
|
155
|
+
color: this.imageColor,
|
156
156
|
};
|
157
157
|
}
|
158
158
|
else {
|
@@ -227,7 +227,7 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
227
227
|
const loadedImage = await (0, utils_1.loadImageFromUrl)(url);
|
228
228
|
if (loadedImage) {
|
229
229
|
const mask = await this.getMask();
|
230
|
-
const { top, left, scaleX, width, angle } = data;
|
230
|
+
const { top, left, scaleX, width, angle, color, type } = data;
|
231
231
|
const ratioWidth = (width * scaleX) / (clipPath.width * clipPath.scaleX);
|
232
232
|
const ratioPosition = this.width / clipPath.width;
|
233
233
|
loadedImage.scaleToWidth(ratioWidth * this.width);
|
@@ -238,7 +238,9 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
|
|
238
238
|
originX: "center",
|
239
239
|
originY: "center",
|
240
240
|
clipPath: mask,
|
241
|
-
filters:
|
241
|
+
filters: type
|
242
|
+
? (0, utils_1.getImageFilters)(type, { color })
|
243
|
+
: this.imageFilters,
|
242
244
|
});
|
243
245
|
loadedImage.applyFilters();
|
244
246
|
return loadedImage;
|