Nat Strangerweather
04/30/2021, 8:38 PMorangy
Nat Strangerweather
05/01/2021, 8:43 AMorangy
Nat Strangerweather
05/01/2021, 9:01 AMSe7eN
05/01/2021, 11:39 AMNat Strangerweather
05/01/2021, 12:36 PMorangy
Nat Strangerweather
05/01/2021, 12:38 PMSe7eN
05/01/2021, 1:03 PMonGlobalPosition
or keep a list of bounds and draw your boxes based on them and update your bounds in your onDrag
or whatever you have for dragging.
I'm doing something like this:
val boxes = remember { mutableStateListOf<MyBoxClass>(...) } // Initialize the default bounds here
Box(modifier = Modifier.fillMaxSize()) {
boxes.forEach { box ->
Box(modifier = Modifier
.offset(box.x, box.y)
.pointerInput(Unit) {
// update bounds here
}
.size(box.width, box.height))
}
}
Nat Strangerweather
05/01/2021, 1:57 PM