API Reference > imodeljs-frontend > Rendering > getCenteredViewRect 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 core/frontend/src/ImageUtil.ts Line 283 Last Updated: 13 June, 2024