expand

Expands drawing beyond the assigned rect on all sides by provided all size.

This modifier may be utilized to workaround (shadow)cropping issues. Apply the same all shift to the inner content as a padding.

AnimatedContent(Modifier.expand(16.dp)) {
CustomContent(Modifier.padding(16.dp))
}

fun Modifier.expand(horizontal: Dp, vertical: Dp): Modifier

Expands drawing beyond the assigned rect on all sides by provided horizontal and vertical size.

This modifier may be utilized to workaround (shadow)cropping issues. Apply the same horizontal and vertical shift to the inner content as a padding.

AnimatedContent(Modifier.expand(horizontal = 16.dp, vertical = 8.dp)) {
CustomContent(Modifier.padding(horizontal = 16.dp, vertical = 8.dp))
}