Fixed a bug with playback never quite getting to the end.
This commit is contained in:
parent
6441a753d5
commit
b8d59cb179
2 changed files with 1 additions and 4 deletions
app
|
@ -336,7 +336,7 @@ module.exports = Surface = class Surface extends CocoClass
|
||||||
|
|
||||||
@lastFrame = @currentFrame
|
@lastFrame = @currentFrame
|
||||||
|
|
||||||
getProgress: -> @currentFrame / @world.frames.length
|
getProgress: -> @currentFrame / Math.max(1, @world.frames.length - 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -262,10 +262,7 @@ module.exports = class LevelPlaybackView extends CocoView
|
||||||
onFrameChanged: (e) ->
|
onFrameChanged: (e) ->
|
||||||
if e.progress isnt @lastProgress
|
if e.progress isnt @lastProgress
|
||||||
@currentTime = e.frame / e.world.frameRate
|
@currentTime = e.frame / e.world.frameRate
|
||||||
# Game will sometimes stop at 29.97, but with only one digit, this is unnecesary.
|
|
||||||
# @currentTime = @totalTime if Math.abs(@totalTime - @currentTime) < 0.04
|
|
||||||
@updatePopupContent() if @timePopup?.shown
|
@updatePopupContent() if @timePopup?.shown
|
||||||
|
|
||||||
@updateProgress(e.progress, e.world)
|
@updateProgress(e.progress, e.world)
|
||||||
@updatePlayButton(e.progress)
|
@updatePlayButton(e.progress)
|
||||||
@lastProgress = e.progress
|
@lastProgress = e.progress
|
||||||
|
|
Reference in a new issue