Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable antialiasing while dragging #157

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading