# invalidateRulers

> Recalculates the [Ruler][androidx.compose.ui.layout.Ruler] values this node provides, without remeasuring or re-placing the node.

## API Reference

### invalidateRulers

> Source set: Common

```kotlin
public fun LayoutModifierNode.invalidateRulers()
```

Recalculates the [Ruler](https://composables.com/jetpack-compose/androidx.compose.ui/ui/classes/Ruler/api.md) values this node provides, without
remeasuring or re-placing the node.

Call this when a value read while providing rulers changes and that value is not snapshot state
(for example, a plain `var` on the node). Changes to `State` read
while providing rulers are observed and recalculate rulers automatically.

Choosing an invalidation:
- [invalidateMeasurement](https://composables.com/jetpack-compose/androidx.compose.ui/ui/functions/invalidateMeasurement/api.md): reruns the measure block. Rulers are recalculated with the new measure
result. Use it when size or child measurement also depends on the changed value.
- [invalidatePlacement](https://composables.com/jetpack-compose/androidx.compose.ui/ui/functions/invalidatePlacement/api.md): reruns the placement block. Does not recalculate rulers; the ruler
values from the last measure result are reused.
- [invalidateRulers](https://composables.com/jetpack-compose/androidx.compose.ui/ui/functions/invalidateRulers/api.md): recalculates only the rulers. This node's measure and placement blocks do
not rerun. Layouts that read the affected rulers are re-placed.

Has no effect if the node is not attached.

## Code Examples

### InvalidateRulersSample

```kotlin
@Sampled
fun InvalidateRulersSample() {
    val ContentBottomRuler = HorizontalRuler()

    // Provides ContentBottomRuler at bottomInset pixels above the bottom of the layout.
    class ContentBottomRulerNode(var bottomInset: Int) : Modifier.Node(), LayoutModifierNode {
```
