Skip to content

Conversation

arnauddorgans
Copy link
Contributor

As reported by hstdt on #279 removing _AspectRatioLayout modifier when aspectRatio is nil fixes the issue

/// fill the parent context.
/// - Returns: A view that constrains this view's dimensions to
/// `aspectRatio`, using `contentMode` as its scaling algorithm.
@ViewBuilder
Copy link
Collaborator

@dreampiggy dreampiggy Mar 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not need ? Seems I can not get what cause this.


Oh, I understand. You change this function to a ViewBuilder with if-else condition and return different View type for (some View), so this is needed

@dreampiggy
Copy link
Collaborator

dreampiggy commented Mar 9, 2024

I just merge and code garden your changes

Since you do not gain the edit access from your fork repo for this PR (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork), you'd better click that Allow edits from maintainers.

Actually, only 3 lines changes is enough. No need for temp func.

@dreampiggy dreampiggy changed the title Fix AnimatedImage Ratio Fix AnimatedImage aspectRatio issue when ratio is nil Mar 9, 2024
@dreampiggy dreampiggy merged commit b7ce54d into SDWebImage:2.x Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants