Abhishek Dewan
07/26/2021, 7:34 AMZach Klippenstein (he/him) [MOD]
07/26/2021, 3:27 PMAbhishek Dewan
07/27/2021, 4:54 AMthisâ–¾
.rotate(90f)
modifier after the .clip
modifier to the image and I get #2 as the result. If you see the outcome you'll see that the image is for some odd reason is clipped on both top and bottom ends. It's centered in the middle. To me it seems like if we can think of the image being a container and the pixels. The container stayed the same as #1 but the pixels were rotated internally so it's still the same portrait image but rotated which kinda leads to it being cut off.
I am not sure if I am doing something wrong but I would love hear if you have thoughts.Abhishek Dewan
07/27/2021, 4:56 AMAbhishek Dewan
07/27/2021, 5:03 AMBoxWithConstraints(Modifier.background(Color.Blue)) {
Image(
painter = remotePainter,
modifier = Modifier
.width(maxWidth)
.height(maxHeight)
.padding(10.dp)
.clip(MaterialTheme.shapes.medium)
.background(Color.Green)
.rotate(90f),
contentDescription = "contentDescription",
contentScale = ContentScale.Crop
)
}
Abhishek Dewan
07/27/2021, 5:08 AMcontentScale = ContentScale.Fit
yields the following result, which leads me to believe that ContentScale.Crop
doesn't work properly because I would assume that crop would just scale the this particular image till, it fills the container