From 67591fe042dbc7b21751344c7ad9494d13d36952 Mon Sep 17 00:00:00 2001 From: Alexander Metz Date: Tue, 11 Feb 2020 11:47:58 +0100 Subject: [PATCH] Include corner positions in selection Fix not being able to select the pixels at bottom and right edges of the screen by including corner positions in the selection. --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 900bdb2..e89950b 100644 --- a/main.c +++ b/main.c @@ -131,8 +131,9 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer, seat->has_selection = true; seat->selection.x = min(anchor_x, seat->x); seat->selection.y = min(anchor_y, seat->y); - seat->selection.width = abs(seat->x - anchor_x); - seat->selection.height = abs(seat->y - anchor_y); + // selection includes the seat and anchor positions + seat->selection.width = abs(seat->x - anchor_x) + 1; + seat->selection.height = abs(seat->y - anchor_y) + 1; break; }