Utility functions for scaling geometry.

Available since

1.0.0

.

Static methods

staticfillRectangle(original:Rectangle, into:Rectangle, ?result:Rectangle):Rectangle

Specifies that the rectangle fills the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio.

Available since

1.0.0

.

staticfitRectangle(original:Rectangle, into:Rectangle, ?result:Rectangle):Rectangle

The entire rectangle will be scaled to fit into the specified area, while maintaining the original aspect ratio. This might leave empty bars at either the top and bottom, or left and right.

Available since

1.0.0

.

staticscaleToFill(originalWidth:Float, originalHeight:Float, targetWidth:Float, targetHeight:Float):Float

Calculates the scale factor to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio.

Available since

1.0.0

.

staticscaleToFit(originalWidth:Float, originalHeight:Float, targetWidth:Float, targetHeight:Float):Float

Calculates the scale factor to fit the original dimensions into the target dimensions, while maintaining the original aspect ratio. This might leave empty bars at either the top and bottom, or left and right.

Available since

1.0.0

.