Skip to content

Commit

Permalink
add SetOnLoop (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
yohamta authored Jun 24, 2023
1 parent 384bd1e commit 7cc9079
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions animation.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ func (anim *Animation) Clone() *Animation {
return &new
}

// SetOnLoop sets the callback function which representing
func (anim *Animation) SetOnLoop(onLoop OnLoop) {
anim.onLoop = onLoop
}

func seekFrameIndex(intervals []time.Duration, timer time.Duration) int {
high, low, i := len(intervals)-2, 0, 0
for low <= high {
Expand Down

0 comments on commit 7cc9079

Please sign in to comment.