Question:
so I have a black box (rectangle) inside another box (boundary) and the rectangle is set as draggableBut now I can drag the rectangle around the whole window, but I want that if the rectangle “leaves” the boundary it should disappear behind it. Is there another modifier I can use for it?
Here a bit context:
My code looks like this:

But it should more like this:

Answer:
On the composable whose contents you want to clip add theclipToBounds()
modifier.If you have better answer, please add a comment about this, thank you!