diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-08-30 19:30:27 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-08-30 19:30:27 +0000 |
| commit | 05888b4706c55109dccc883274ce5359d7e7c83c (patch) | |
| tree | cc54aba53264a41e17d96f800bad4d80a7363044 /input.c | |
| parent | render: search box: use colors from the color table (diff) | |
input: bug: account for margins when converting mouse coords to row/col
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -407,8 +407,8 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, int x = wl_fixed_to_int(surface_x) * 1;//backend->monitor->scale; int y = wl_fixed_to_int(surface_y) * 1;//backend->monitor->scale; - int col = x / term->cell_width; - int row = y / term->cell_height; + int col = (x - term->x_margin) / term->cell_width; + int row = (y - term->y_margin) / term->cell_height; if (col < 0 || row < 0 || col >= term->cols || row >= term->rows) return; |
