summaryrefslogtreecommitdiff
path: root/lisp/image.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/image.el')
-rw-r--r--lisp/image.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/image.el b/lisp/image.el
index c66440c86e7..6da3a0b6cd0 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -804,19 +804,22 @@ If the image has a non-nil :speed property, it acts as a multiplier
for the animation speed. A negative value means to animate in reverse."
(when (and (buffer-live-p (plist-get (cdr image) :animate-buffer))
;; Delayed more than two seconds more than expected.
- (or (<= (- (float-time) target-time) 2)
+ (or (time-less-p (time-since target-time) 2)
(progn
(message "Stopping animation; animation possibly too big")
nil)))
(image-show-frame image n t)
(let* ((speed (image-animate-get-speed image))
- (time (float-time))
+ (time (current-time))
(animation (image-multi-frame-p image))
+ (time-to-load-image (time-since time))
+ (stated-delay-time (/ (or (cdr animation)
+ image-default-frame-delay)
+ (float (abs speed))))
;; Subtract off the time we took to load the image from the
;; stated delay time.
- (delay (max (+ (* (or (cdr animation) image-default-frame-delay)
- (/ 1.0 (abs speed)))
- time (- (float-time)))
+ (delay (max (float-time (time-subtract stated-delay-time
+ time-to-load-image))
image-minimum-frame-delay))
done)
(setq n (if (< speed 0)