@leapfrog/interactive-canvas 1.4.1 → 1.4.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.
|
@@ -2545,6 +2545,12 @@ var AbstractInteractiveCanvas = /** @class */ (function () {
|
|
|
2545
2545
|
*/
|
|
2546
2546
|
AbstractInteractiveCanvas.prototype.setDimensionRestrictions = function (restrictions) {
|
|
2547
2547
|
this.dimensionRestrictions$.next(restrictions);
|
|
2548
|
+
var dimensions = this.getDimensions();
|
|
2549
|
+
if (this.dimensionsExceedRestrictions(dimensions)) {
|
|
2550
|
+
var newDimensions = dimensions
|
|
2551
|
+
.withSize(Math.min(Math.max(oc(restrictions).width.min(dimensions.width), dimensions.width), Math.max(oc(restrictions).width.max(dimensions.width))), Math.min(Math.max(oc(restrictions).height.min(dimensions.height), dimensions.height), Math.max(oc(restrictions).height.max(dimensions.height))));
|
|
2552
|
+
this.setBaseDimensions(newDimensions);
|
|
2553
|
+
}
|
|
2548
2554
|
};
|
|
2549
2555
|
AbstractInteractiveCanvas.prototype.getMargin = function () {
|
|
2550
2556
|
var borderWidth = this.getObjectsByTypeInternal(ObjectType.BORDER)
|
|
@@ -2545,6 +2545,12 @@ var AbstractInteractiveCanvas = /** @class */ (function () {
|
|
|
2545
2545
|
*/
|
|
2546
2546
|
AbstractInteractiveCanvas.prototype.setDimensionRestrictions = function (restrictions) {
|
|
2547
2547
|
this.dimensionRestrictions$.next(restrictions);
|
|
2548
|
+
var dimensions = this.getDimensions();
|
|
2549
|
+
if (this.dimensionsExceedRestrictions(dimensions)) {
|
|
2550
|
+
var newDimensions = dimensions
|
|
2551
|
+
.withSize(Math.min(Math.max(tsOptchain.oc(restrictions).width.min(dimensions.width), dimensions.width), Math.max(tsOptchain.oc(restrictions).width.max(dimensions.width))), Math.min(Math.max(tsOptchain.oc(restrictions).height.min(dimensions.height), dimensions.height), Math.max(tsOptchain.oc(restrictions).height.max(dimensions.height))));
|
|
2552
|
+
this.setBaseDimensions(newDimensions);
|
|
2553
|
+
}
|
|
2548
2554
|
};
|
|
2549
2555
|
AbstractInteractiveCanvas.prototype.getMargin = function () {
|
|
2550
2556
|
var borderWidth = this.getObjectsByTypeInternal(exports.ObjectType.BORDER)
|