mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-10 05:33:51 -04:00
term: resize: pre-calculate right/bottom margins
This commit is contained in:
parent
7fd380f253
commit
d804bc8579
4 changed files with 51 additions and 55 deletions
4
input.c
4
input.c
|
|
@ -687,8 +687,8 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
|
|||
int x = wl_fixed_to_int(surface_x) * term->scale;
|
||||
int y = wl_fixed_to_int(surface_y) * term->scale;
|
||||
|
||||
int col = (x - term->x_margin) / term->cell_width;
|
||||
int row = (y - term->y_margin) / term->cell_height;
|
||||
int col = (x - term->margins.left) / term->cell_width;
|
||||
int row = (y - term->margins.top) / term->cell_height;
|
||||
|
||||
if (col < 0 || row < 0 || col >= term->cols || row >= term->rows)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue