Skip to content

Commit

Permalink
Merge pull request #85 from sidepelican/fast_bg
Browse files Browse the repository at this point in the history
step any frames in one tick
  • Loading branch information
onevcat authored Dec 28, 2018
2 parents 79a8e94 + 6b6e421 commit 332578c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion APNGKit/APNGImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,11 @@ open class APNGImageView: APNGView {
lastTimestamp = timestamp

currentPassedDuration += elapsedTime
if let duration = image.duration, currentPassedDuration > duration {
currentPassedDuration = currentPassedDuration.truncatingRemainder(dividingBy: duration)
}

if currentPassedDuration >= currentFrameDuration {
while currentPassedDuration >= currentFrameDuration {
currentFrameIndex = currentFrameIndex + 1

if currentFrameIndex == image.frameCount {
Expand Down

0 comments on commit 332578c

Please sign in to comment.