adjustFrameWaitTime in Movie#stop

openid
Marcin Kulik 13 years ago
parent 07eeb1e81b
commit 0d77b843d3

@ -75,13 +75,19 @@ class AsciiIo.Movie
@nextFrame()
stop: ->
clearInterval @nextFrameTimeoutId
@playing = false
@cancelNextFrameProcessing()
now = @now()
@adjustFrameWaitTime(now)
@pausedAt = now
cancelNextFrameProcessing: ->
clearInterval @nextFrameTimeoutId
adjustFrameWaitTime: (now) ->
resumedAt = @resumedAt or @lastFrameAt
currentWaitTime = now - resumedAt
@totalFrameWaitTime += currentWaitTime
@pausedAt = now
restart: ->
@reset()

Loading…
Cancel
Save