Skip to content

Commit

Permalink
use early return
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth authored Dec 29, 2024
1 parent 9e80034 commit 274dc9d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions animation.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@ func (i *IndefiniteAnimation) Stop() {
}

func (i *IndefiniteAnimation) setupAnimation() {
if !i.isSetup {
i.animation = Animation{
Tick: func(_ float32) {
i.Tick()
},
Curve: AnimationLinear, // any curve will work
Duration: 1 * time.Second, // anything positive here will work
RepeatCount: AnimationRepeatForever,
}
i.isSetup = true
if i.isSetup {
return
}

i.animation = Animation{
Tick: func(_ float32) {
i.Tick()
},
Curve: AnimationLinear, // any curve will work
Duration: 1 * time.Second, // anything positive here will work
RepeatCount: AnimationRepeatForever,
}
i.isSetup = true
}

func animationEaseIn(val float32) float32 {
Expand Down

0 comments on commit 274dc9d

Please sign in to comment.