Stylianos Gakis
05/02/2025, 10:22 AMJonathan
05/02/2025, 1:03 PMModifier.clipToBounds()
?
Box(Modifier.fillMaxSize()) {
Box(
modifier = Modifier
.drawBehind {
drawRect(
color = Color.Green,
topLeft = Offset(x = 10.dp.toPx(), y = 0F),
size = Size(400.dp.toPx())
)
}
.clipToBounds()
) {
Box(Modifier.size(300.dp)
.background(Color.Yellow)
.size(300.dp))
}
}
This code produces the following result:Stylianos Gakis
05/02/2025, 1:53 PMwrapContentHeight(unbounded = true)
efemoney
05/03/2025, 6:44 AMStylianos Gakis
05/03/2025, 8:15 AM