Skip to content

Fixed the alignment issue when both crossfade and placeholder are present in AsyncImage.#3240

Open
pb-jithin wants to merge 1 commit into
coil-kt:mainfrom
pb-jithin:issue-fix-3234
Open

Fixed the alignment issue when both crossfade and placeholder are present in AsyncImage.#3240
pb-jithin wants to merge 1 commit into
coil-kt:mainfrom
pb-jithin:issue-fix-3234

Conversation

@pb-jithin

Copy link
Copy Markdown

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