Skip to content

Commit

Permalink
Disable antialiasing while dragging
Browse files Browse the repository at this point in the history
Signed-off-by: g-rden <[email protected]>
  • Loading branch information
g-rden committed Jul 15, 2024
1 parent 0ddc367 commit cd8fd5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit cd8fd5f

Please sign in to comment.