getCenteredViewRect Function

Beta  

Determine maximum ViewRect that can be fitted and centered in specified ViewRect given a required aspect ratio.

getCenteredViewRect(viewRect: ViewRect, aspectRatio: number = 1.4): ViewRect

Parameter Type Description
viewRect ViewRect view rectangle
aspectRatio number width/height ratio

Returns - ViewRect

A ViewRect centered in the input rectangle.

Defined in

Last Updated: 13 June, 2024