getCenteredViewRect Function
Determine the maximum ViewRect that can be fitted and centered in specified ViewRect given a required aspect ratio.
getCenteredViewRect(viewRect: ViewRect, aspectRatio: number1.4): ViewRect
@returns A ViewRect centered in the input rectangle.
Parameter | Type | Description |
---|---|---|
viewRect | ViewRect | The rectangle in which the returned rectangle is to be centered and fitted. |
aspectRatio | number | Ratio of width to height. |
Returns - ViewRect
A ViewRect centered in the input rectangle.
Defined in
Last Updated: 21 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.