The current width
and height
are adjusted to fit inside the given dimensions, while keeping the aspect ratio.
If fit
is true there may be some space inside the target area which is not covered if its aspect ratio differs.
If fit
is false the size may extend further out than the target area if the aspect ratios differ.
If this Size component has a parent set, then the width and height passed to this method will be clamped so it cannot exceed that of the parent.
name | type | arguments | Default | description |
---|---|---|---|---|
width | number | <optional> | 0 |
The new width of the Size component. |
height | number | <optional> |
The new height of the Size component. If not given, it will use the width value. |
|
fit | boolean | <optional> | true |
Perform a |
This Size component instance.