Skip to content

Commit

Permalink
Include corner positions in selection
Browse files Browse the repository at this point in the history
Fix not being able to select the pixels at bottom and right edges of the
screen by including corner positions in the selection.
  • Loading branch information
a-metz authored and emersion committed Feb 11, 2020
1 parent cdab5c9 commit 67591fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 67591fe

Please sign in to comment.