Skip to content

Commit

Permalink
update file ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth authored Dec 31, 2024
1 parent 4042e02 commit 65ef364
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions animation.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ type Animation struct {
Tick func(float32)
}

// IndefiniteAnimation represents an animation that continues indefinitely. It has no duration
// or curve, and when started, the Tick function will be called every frame until Stop is invoked.
//
// Since: 2.6
type IndefiniteAnimation struct {
Tick func()

isSetup bool
animation Animation
}

// NewAnimation creates a very basic animation where the callback function will be called for every
// rendered frame between [time.Now] and the specified duration. The callback values start at 0.0 and
// will be 1.0 when the animation completes.
Expand All @@ -64,14 +53,6 @@ func NewAnimation(d time.Duration, fn func(float32)) *Animation {
return &Animation{Duration: d, Tick: fn}
}

// NewIndefiniteAnimation creates an indefinite animation where the callback function will be called
// for every rendered frame once started, until stopped.
//
// Since: 2.6
func NewIndefiniteAnimation(fn func()) *IndefiniteAnimation {
return &IndefiniteAnimation{Tick: fn}
}

// Start registers the animation with the application run-loop and starts its execution.
func (a *Animation) Start() {
CurrentApp().Driver().StartAnimation(a)
Expand All @@ -82,6 +63,25 @@ func (a *Animation) Stop() {
CurrentApp().Driver().StopAnimation(a)
}

// IndefiniteAnimation represents an animation that continues indefinitely. It has no duration
// or curve, and when started, the Tick function will be called every frame until Stop is invoked.
//
// Since: 2.6
type IndefiniteAnimation struct {
Tick func()

isSetup bool
animation Animation
}

// NewIndefiniteAnimation creates an indefinite animation where the callback function will be called
// for every rendered frame once started, until stopped.
//
// Since: 2.6
func NewIndefiniteAnimation(fn func()) *IndefiniteAnimation {
return &IndefiniteAnimation{Tick: fn}
}

// Start registers the animation with the application run-loop and starts its execution.
func (i *IndefiniteAnimation) Start() {
i.setupAnimation()
Expand Down

0 comments on commit 65ef364

Please sign in to comment.