Hi folks, I’m drawing an image at “wider than full...
# compose
s
Hi folks, I’m drawing an image at “wider than full screen width”, but then panning it to the left as the user swipes in a ViewPager. However, the image gets cut off on the right once the negative offset is applied. Is there a quick way to prevent this?
m
My guess is that the image is assuming the same size as it’s parent Box component, and when you pass the offset modifier, it’s offsetting the actual Image component, not what’s inside of it. The Image component itself will remain the same exact size. I think what you want to do is figure out how to shift the image content within the Image component itself.
s
Thanks, that was helpful! I figured out a way to shift the content of the image within the Image using the
alignment
parameter. It’s still not perfect, but better than my first approach.