The following code gives me output I did not expect.
@Composable
fun App() {
MaterialTheme {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Gray)
,
) {
Image(
modifier = Modifier
.rotate(90f)
.fillMaxSize()
,
painter = painterResource(Res.drawable.hello),
contentDescription = null,
)
}
}
}
The image is rotated but it does not fill the size of its parent. Instead I would expect the image to fill one or two dimensions of the parent, like illustrated on the right.
Actual result vs. Expected result:

I have tried to set the contentScale to ContentScale.Crop but that results in even worse output:

