Travis Griggs
05/09/2023, 6:36 PMCanvas(modifier = Modifier.fillMaxSize()) {
cameraPositionState.projection?.let { projection ->
/* draw stuff based on projection */ }}
things work fine. But if switch those around:
cameraPositionState.projection?.let { projection ->
Canvas(modifier = Modifier.fillMaxSize()) {
/* draw stuff based on projection */ }}
then it does an initial draw, but even if it updates, uses the original projection.
IIUC, in the first one, the draw scope, upon reading/accessing the cameraPositionState creates a dependency that causes the Canvas to recompose when the state changes. So it works.
But in the second case, I would have thought that same thing would have happened at the Box level. A change in cameraState would cause it to reissue the Canvas composable. But that doesn't seem to happen. There's a puzzle piece that doesn't fit yet for me.Colton Idle
05/09/2023, 7:48 PMTravis Griggs
05/09/2023, 8:32 PM