EmergeTools / Pow

Delightful SwiftUI effects for your app

Home Page:https://movingparts.io/pow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anvil Animation Smoke Clipping

rehatkathuria opened this issue · comments

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)

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.

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)
    }
}

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

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?

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

Fixed in #23