Krolyxon
Commit 0f3766e

Branches

Refs →

nsxiv0f3766e

fix: animation slowdown when zoomed in (#200)

rendering is a pretty expensive operation, especially when scaling with
anti-aliasing. by waiting for the image to render before setting
timeout, the actual timeout ends up being (render time + actual delay).

this pretty much fixes the slowdown entirely on all the images i've
tested. it should also improve things noticeably even in cases where
the delay between frames is shorter than how fast we can render.
although on such images, the issue may not be fixed entirely.
Author
N-R-K
Date
2022-01-03 02:07 +0600
Committer
GitHub · 2022-01-03 02:07 +0600
Parent
e839638
Commit
0f3766eaaba949bc2eac276cb0a08e0195c17441

+1 −1

1 file changed

  1. M main.c +1 −1
M main.c View
@@ -470,8 +470,8 @@ void reset_cursor(void)
470470 void animate(void)
471471 {
472472 if (img_frame_animate(&img)) {
473− redraw();
474473 set_timeout(animate, img.multi.frames[img.multi.sel].delay, true);
474+ redraw();
475475 }
476476 }
477477