Skip to content

Using the wrapper on watchOS AnimatedImage as well, try to solve the SwiftUI bug of aspectRatio #48

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

Merged
merged 4 commits into from
Nov 9, 2019

Conversation

dreampiggy
Copy link
Collaborator

@dreampiggy dreampiggy commented Nov 9, 2019

When using this code, the result on watchOS is wrong:

WebImage(url: URL(string:url))
.resizable()
.scaledToFill() // not fit
.frame(width: CGFloat(100), height: CGFloat(100), alignment: .center)

Before Fix (wrong, still fit):

image

After Fix (correct, fill):
image

Another big fix that the AnimatedImage's data: or name: initializer does not works, because of #46 changes using the @State

…at aspectRatio does not works as expected.

This code by using the native UIView and logic by reverse engineering
@dreampiggy dreampiggy added animated image AnimatedImage struct fix labels Nov 9, 2019
@dreampiggy dreampiggy force-pushed the bugfix_animated_image_watchOS branch from b3c382a to 28dbd8e Compare November 9, 2019 21:51
@dreampiggy dreampiggy merged commit fd40189 into master Nov 9, 2019
@dreampiggy dreampiggy deleted the bugfix_animated_image_watchOS branch November 9, 2019 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
animated image AnimatedImage struct fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant