Skip to content

Conversation

@pb-jithin
Copy link

Fixed the alignment issue when both crossfade and placeholder are present in AsyncImage.
The problem was that CrossfadePainter always centered its child painters, overriding the alignment set on AsyncImage.
Changes made:
CrossfadePainter.kt: Added alignment parameter and updated drawPainter() to use alignment instead of centering
AsyncImagePainter.kt: Added alignment property and passed it to maybeNewCrossfadePainter
AsyncImagePainter.android.kt and AsyncImagePainter.nonAndroid.kt: Updated maybeNewCrossfadePainter to accept and pass alignment to CrossfadePainter
ContentPainterModifier.kt: Updated to set alignment on AsyncImagePainter when creating/updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants