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

Add a way to create an infinite animation #4735

Open
2 tasks done
dweymouth opened this issue Mar 23, 2024 · 1 comment
Open
2 tasks done

Add a way to create an infinite animation #4735

dweymouth opened this issue Mar 23, 2024 · 1 comment

Comments

@dweymouth
Copy link
Contributor

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

The fyne.NewAnimation API takes a duration argument and ends the animation after the given duration. I had thought that a duration of 0 might be used to create an infinite animation, but it does not, nor is it documented as such.

Is it possible to construct a solution with the existing API?

No. Closest thing is to use math.MaxInt64 as the duration which is about 290 years (which is good enough for all practical purposes but not clean code).

Describe the solution you'd like to see.

An API fyne.NewIndefiniteAnimation(tick func(f float64)) or a clarification of the existing fyne.NewAnimation that 0 can be used for infinite duration (since an animation of duration 0 is not useful anyway.

@andydotxyz
Copy link
Member

Sounds like a nice feature request - but let's make it explicit as shown in the API you propose.
Something lasting for 0 milliseconds should not run forever,

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

2 participants