From cd8fd5f8eb599732990647fc0478496299f6d4cd Mon Sep 17 00:00:00 2001 From: g-rden Date: Mon, 15 Jul 2024 20:59:04 +0200 Subject: [PATCH] Disable antialiasing while dragging Signed-off-by: g-rden --- src/ui.c | 1 + src/viewer.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/ui.c b/src/ui.c index 862968c..4c2621d 100644 --- a/src/ui.c +++ b/src/ui.c @@ -347,6 +347,7 @@ static void on_pointer_button(void* data, struct wl_pointer* wl_pointer, if (button == BTN_LEFT) { ctx.mouse.active = (state == WL_POINTER_BUTTON_STATE_PRESSED); } + ui_redraw(); } static void on_pointer_axis(void* data, struct wl_pointer* wl_pointer, diff --git a/src/viewer.c b/src/viewer.c index 151cf99..f3b1d7d 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -880,12 +880,15 @@ void viewer_on_drag(int dx, int dy) { const ssize_t old_x = ctx.img_x; const ssize_t old_y = ctx.img_y; + const bool aa = ctx.antialiasing; ctx.img_x += dx; ctx.img_y += dy; if (ctx.img_x != old_x || ctx.img_y != old_y) { + ctx.antialiasing = false; fixup_position(false); ui_redraw(); + ctx.antialiasing = aa; } }