Skip to content
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

Anvil Animation Smoke Clipping #21

Closed
rehatkathuria opened this issue Mar 19, 2023 · 6 comments
Closed

Anvil Animation Smoke Clipping #21

rehatkathuria opened this issue Mar 19, 2023 · 6 comments
Assignees

Comments

@rehatkathuria
Copy link

The smoke layer from the anvil animation has the top part of it clipped towards the end of the animation.

Tested on Simulator iPhone SE (3rd Generation)

@robb
Copy link
Contributor

robb commented Mar 20, 2023

Looking into it! Do you happen to have the view dimensions at hand? Feel free to send me a screenshot via email robb@movingparts.io if you don't want to post this here.

@robb
Copy link
Contributor

robb commented Mar 21, 2023

Found a way to reproduce:

import SwiftUI
import Pow

struct ContentView: View {
    @State
    var isOn: Bool = true

    var body: some View {
        VStack {
            GroupBox {
                Toggle("Visible", isOn: $isOn.animation())
            }

            Spacer()

            if isOn {
                Color.blue
                    .frame(width: 200, height: 1)
                    .transition(.movingParts.anvil)
            }

            Spacer()
        }
        .padding()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        NavigationStack {
            ContentView()
        }
        .environment(\.colorScheme, .dark)
    }
}

@rehatkathuria
Copy link
Author

Apologies for the slow reply, yesterday was very busy for me! Thank you for addressing/reproducing so quickly!

@robb
Copy link
Contributor

robb commented Mar 21, 2023

No worries, I think as a quick fix you can try to increase the size of the view the effect is installed on, as it seems to be related to the height/aspect ratio?

E.g. something like

myView
  .padding(.vertical, 24)
  .transition(.movingParts.anvil)
  .padding(.vertical, -24)

might work?

@rehatkathuria
Copy link
Author

Will give this a go later and report back, thank you

@robb
Copy link
Contributor

robb commented May 19, 2023

Fixed in #23

@robb robb closed this as completed May 19, 2023
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

No branches or pull requests

3 participants