You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to display a drawable via CoilImage but when setting its size whether via size or preferredSize the image is not centered properly and have seemed to be crop and not centered. Although I seemed to have found a slight workaround where you set CircleCropTransform and it will work just fine, or I can also remove the size modifier and let it set its own size. But I do not want the image to be cropped and also I want to be able to set the size.
Here is my code snippet and the image of what happens
The text was updated successfully, but these errors were encountered:
OliverRhyme
changed the title
CoilImage: Size modifier not work properly when drawable data is passed.
CoilImage: Size modifier not working properly when drawable data is passed.
Dec 6, 2020
CoilImage is not meant to take a Drawable. The data parameter is there for you to tell Coil what image to load. If you want to load a drawable, you can do: CoilImage(R.mipmap.ic_launcher).
The fact that this drawn anything is undefined, so closing this.
CoilImage is not meant to take a Drawable. The data parameter is there for you to tell Coil what image to load. If you want to load a drawable, you can do: CoilImage(R.mipmap.ic_launcher).
The fact that this drawn anything is undefined, so closing this.
AFAIK there is a Fetcher for the Drawable so I can pass it directly. Anyways I tried CoilImage(R.mipmap.ic_launcher) still the same output with my previous code. The image is still not centered and aligned if I set a modifier. It works fine if I don't set a modifier but I cannot set the size of the composable without the modifier. I also found that this bug only works with Drawable (id reference or actual object) and not with other images and the modifier works as expected.
I am trying to display a drawable via CoilImage but when setting its size whether via size or preferredSize the image is not centered properly and have seemed to be crop and not centered. Although I seemed to have found a slight workaround where you set CircleCropTransform and it will work just fine, or I can also remove the size modifier and let it set its own size. But I do not want the image to be cropped and also I want to be able to set the size.
Here is my code snippet and the image of what happens
Compose Version: 1.0.0-alpha08
The text was updated successfully, but these errors were encountered: