viewportRect
Declaration
func viewportRect(fittingIn drawableSize: CGSize, displayOrientation: UIInterfaceOrientation? = nil) -> CGRect
Summary
Parameters
| Name | Type | Summary |
|---|---|---|
| drawableSize | CGSize | - |
| displayOrientation | UIInterfaceOrientation? | - |
| Name | Type | Summary |
|---|---|---|
| drawableSize | CGSize | - |
| displayOrientation | UIInterfaceOrientation? | - |
Returns the viewport rect to use when rendering into the given drawable size.
- Live: returns the full drawable (origin zero, size = drawableSize).
- Playback: returns an aspect-fill rect so the camera image aligns with the rendered content; pass
displayOrientation(current device orientation) so the viewport fits correctly in portrait and landscape.