# Sandbox.UI.CanvasPanel.FitBounds

```csharp
void FitBounds(Rect bounds, Vector2 padding = null, Vector2 minimumPadding = null)
```

Frame bounds in canvas coordinates with padding on each side, expressed as a fraction
of their size. Minimum padding is in canvas units. Navigation limits take precedence.

### Parameters

- `bounds` (`Rect`)
- `padding` (`Vector2`), default `null`
- `minimumPadding` (`Vector2`), default `null`

Declared in [Sandbox.UI.CanvasPanel](/api/Sandbox.UI.CanvasPanel).
Assembly: `Sandbox.Engine`.
