---
title: "offset"
description: "Returns the Constraints obtained by offsetting the current instance with the given values."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun Constraints.offset(horizontal: Int = 0, vertical: Int = 0) =
    Constraints(
        (minWidth + horizontal).fastCoerceAtLeast(0),
        addMaxWithMinimum(maxWidth, horizontal),
        (minHeight + vertical).fastCoerceAtLeast(0),
        addMaxWithMinimum(maxHeight, vertical),
    )
```


Returns the Constraints obtained by offsetting the current instance with the given values.



