|
|
@ -13,8 +13,8 @@ class Modifier { |
|
|
|
* @returns {Modifier} this modifier object |
|
|
|
*/ |
|
|
|
fillMaxSize(widthFraction = 1, heightFraction = 1) { |
|
|
|
this.fillMaxWidth(widthFraction); |
|
|
|
return this.fillMaxHeight(heightFraction); |
|
|
|
return this.fillMaxWidth(widthFraction) |
|
|
|
.fillMaxHeight(heightFraction); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -60,7 +60,7 @@ class Modifier { |
|
|
|
padding(siding) { |
|
|
|
let keyToAdd = ""; |
|
|
|
if (siding instanceof ChainablePadding || siding instanceof PaddingChain) { |
|
|
|
|
|
|
|
|
|
|
|
} else if (siding instanceof Sides) { |
|
|
|
keyToAdd = "padding-" |
|
|
|
} |
|
|
@ -157,26 +157,42 @@ class Modifier { |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* @returns {DimensionsChain} |
|
|
|
* @param {number} size of width and height in pixels |
|
|
|
* @returns {DimensionsChain} |
|
|
|
*/ |
|
|
|
linkDimensions() { |
|
|
|
return new DimensionsChain(this); |
|
|
|
linkDimensions(size = -1) { |
|
|
|
if (size === -1) { |
|
|
|
return new DimensionsChain(this); |
|
|
|
} else { |
|
|
|
return new DimensionsChain(this).all(size).ensureModifier() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* @returns {PaddingChain} |
|
|
|
* @param {number} amount the padding for all four sides |
|
|
|
* @returns {PaddingChain} |
|
|
|
*/ |
|
|
|
linkPadding() { |
|
|
|
return new PaddingChain(this); |
|
|
|
linkPadding(amount = -1) { |
|
|
|
if (amount === -1) { |
|
|
|
return new PaddingChain(this); |
|
|
|
} else { |
|
|
|
return new PaddingChain(this).all(amount); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* @param {number} cornerRadius will create a rounded rectangle with the given cornerRadius |
|
|
|
* @returns {ShapeChain} |
|
|
|
*/ |
|
|
|
linkClip() { |
|
|
|
return new ShapeChain(this); |
|
|
|
linkClip(cornerRadius = -1) { |
|
|
|
if (cornerRadius === -1) { |
|
|
|
return new ShapeChain(this); |
|
|
|
} else { |
|
|
|
return new ShapeChain(this).all(cornerRadius); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|