-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KamelImage fills up max size #94
Comments
@zeroeightysix So that modifier will actually cause it to fill the size of Also you can always make your own version of |
As the box sizes to fit its contents, it will grow larger than the image dimensions themselves. You'd expect, without any modifiers, for the box to be the same size as the actual image, tightly wrapping around it. Instead, both the box and inner |
Yeah I suppose it makes more sense to display an image in its actual size by default. I think it should just work that way if I removed that modifier... The only thing I'm worried about is that it may cause issues with |
I have the same issue. I'm loading image that can have basically any dimentions and I want the contentScale to adjust the size to hardcoded height of 50.dp, but the below code does not wrap the width of the image, but uses the whole width of the Row in which it is placed. In the same Row I need Spacer with weight (to take any space left) and some other items on the right, so I really need the width to be taken from scaling the content, which does not happen right now
I was able to resove my issue by using custom KamelImageBox, but I find this default behaviour to be counter-intuitive. |
If you want to make a proposal as a pr with your custom kamel image I can take a look and we can go from there @wuujcik |
Rather counterintuitively, and annoyingly,
KamelImage
without aModifier
to restrict its size will consume all space it can get due to this default modifier:Kamel/kamel-image/src/commonMain/kotlin/io/kamel/image/KamelImage.kt
Lines 45 to 54 in 291f157
This leads to it being the case that if you include any image in an unbounded box that the entire UI just becomes that image. For our usecase, we have a very wide banner image that is supposed to fill up the parent's entire width but not the height. This default prevents that from happening 🙁
Can't we make the inner
Image
have no modifier?The text was updated successfully, but these errors were encountered: