---
title: "clamped(to:)"
framework: spatial
role: symbol
role_heading: Instance Method
path: "spatial/clampablewithinrectprotocol/clamped(to:)"
---

# clamped(to:)

Returns the entity with coordinates clamped to the specified rectangle.

## Declaration

```swift
func clamped(to rect: Self.Rect) -> Self
```

## Parameters

- `rect`: The rectangle that defines the clamp volume.

## Discussion

Discussion Returns An entity that’s clamped to the specified rectangle.
