@leapfrog/interactive-canvas 1.13.1 → 1.13.2
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.
|
@@ -1524,7 +1524,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
1524
1524
|
px = maxWidth;
|
|
1525
1525
|
}
|
|
1526
1526
|
var premultipliedWidth = this.fabricObject.width;
|
|
1527
|
-
var newScale = px / premultipliedWidth;
|
|
1527
|
+
var newScale = (premultipliedWidth > 0) ? px / premultipliedWidth : 1;
|
|
1528
1528
|
this.fabricObject.set({ scaleX: newScale, scaleY: newScale });
|
|
1529
1529
|
this.setCoords();
|
|
1530
1530
|
this.canvas.notifyObjectListChanged();
|
|
@@ -1526,7 +1526,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
1526
1526
|
px = maxWidth;
|
|
1527
1527
|
}
|
|
1528
1528
|
var premultipliedWidth = this.fabricObject.width;
|
|
1529
|
-
var newScale = px / premultipliedWidth;
|
|
1529
|
+
var newScale = (premultipliedWidth > 0) ? px / premultipliedWidth : 1;
|
|
1530
1530
|
this.fabricObject.set({ scaleX: newScale, scaleY: newScale });
|
|
1531
1531
|
this.setCoords();
|
|
1532
1532
|
this.canvas.notifyObjectListChanged();
|