summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-01-02 21:07:43 +0100
committerGitHub <noreply@github.com>2022-01-02 21:07:43 +0100
commit0f3766eaaba949bc2eac276cb0a08e0195c17441 (patch)
tree0e9677be436e0aa658274270f5ad8b7074595d92
parente839638156b5d2443fed1ce49786c2788f6205aa (diff)
downloadnsxiv-0f3766eaaba949bc2eac276cb0a08e0195c17441.tar.zst
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. Closes: https://github.com/nsxiv/nsxiv/issues/70
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 732e690..0bd923e 100644
--- a/main.c
+++ b/main.c
@@ -470,8 +470,8 @@ void reset_cursor(void)
void animate(void)
{
if (img_frame_animate(&img)) {
- redraw();
set_timeout(animate, img.multi.frames[img.multi.sel].delay, true);
+ redraw();
}
}