Function

invalidateRulers

Recalculates the Ruler values this node provides, without remeasuring or re-placing the node.

invalidateRulers

Source set: Common
public fun LayoutModifierNode.invalidateRulers()

Recalculates the Ruler 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:

    result. Use it when size or child measurement also depends on the changed value.

  • invalidateMeasurement: reruns the measure block. Rulers are recalculated with the new measure
  • values from the last measure result are reused.

  • invalidatePlacement: reruns the placement block. Does not recalculate rulers; the ruler
  • not rerun. Layouts that read the affected rulers are re-placed.

  • invalidateRulers: recalculates only the rulers. This node's measure and placement blocks do

Has no effect if the node is not attached.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: