adjustFrameWaitTime in Movie#stop
This commit is contained in:
parent
07eeb1e81b
commit
0d77b843d3
@ -75,13 +75,19 @@ class AsciiIo.Movie
|
|||||||
@nextFrame()
|
@nextFrame()
|
||||||
|
|
||||||
stop: ->
|
stop: ->
|
||||||
clearInterval @nextFrameTimeoutId
|
|
||||||
@playing = false
|
@playing = false
|
||||||
|
@cancelNextFrameProcessing()
|
||||||
now = @now()
|
now = @now()
|
||||||
|
@adjustFrameWaitTime(now)
|
||||||
|
@pausedAt = now
|
||||||
|
|
||||||
|
cancelNextFrameProcessing: ->
|
||||||
|
clearInterval @nextFrameTimeoutId
|
||||||
|
|
||||||
|
adjustFrameWaitTime: (now) ->
|
||||||
resumedAt = @resumedAt or @lastFrameAt
|
resumedAt = @resumedAt or @lastFrameAt
|
||||||
currentWaitTime = now - resumedAt
|
currentWaitTime = now - resumedAt
|
||||||
@totalFrameWaitTime += currentWaitTime
|
@totalFrameWaitTime += currentWaitTime
|
||||||
@pausedAt = now
|
|
||||||
|
|
||||||
restart: ->
|
restart: ->
|
||||||
@reset()
|
@reset()
|
||||||
|
Loading…
Reference in New Issue
Block a user