2.11 - Scaling
Rectangle
s and TwoDimensional
s can now be scaled within another one!
This is handy for when you need, for instance, a photo to be scaled down to fit in a chat message, or a wallpaper to be scaled up to fill a background.
The following scaling methods and directions are supported, and tested with 648 test assertions to guarantee expected behavior:
Methods
- Fit - Ensure the whole object is visible without clipping within its parent
- Fill - Ensure the whole parent is filled with this object, exceeding boundaries as necessary, but not scaling larger than needed
- Match height - The object is scaled to match the height of its parent, exceeding horizontal boundaries as necessary
- Match width - The object is scaled to match the width of its parent, exceeding vertical boundaries as necessary
- Stretch - The object is made the same as its parent
Directions
- Down - The object will either remain the same size or reduce in size
- Up or down - The object will increase or reduce in size as necessary