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

Handle initial zero values of GeometryProxy #2

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

stonko1994
Copy link
Owner

Description

Problem

When using Marquee inside a .sheet it can happen that the animation is not performing as expected. This can happen because the initial size of the GeometryProxy is .zero. (ref)

Changes

React to changes of GeometryProxy with a .onChange(of: proxy.size.width) modifier and initialize the animation once a non .zero width was received.

Tests

This can be tested by using a .sheet in the preview:

Text("Foo")
    .sheet(isPresented: .constant(true)) {
        Marquee {
            Text("Hello World!")
                .fontWeight(.bold)
                .font(.system(size: 40))
        }
    }

@stonko1994 stonko1994 merged commit 35445ee into main Mar 29, 2024
@stonko1994 stonko1994 deleted the feature/fix-animation-inside-sheet branch March 29, 2024 10:24
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.

1 participant