input: scale coordinates in wl_pointer_enter()

This commit is contained in:
Daniel Eklöf 2019-09-26 18:41:26 +02:00
parent 2d6369482e
commit f862f173f5
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -383,8 +383,8 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
{
struct terminal *term = data;
int x = wl_fixed_to_int(surface_x) * 1; //scale
int y = wl_fixed_to_int(surface_y) * 1; //scale
int x = wl_fixed_to_int(surface_x) * term->scale;
int y = wl_fixed_to_int(surface_y) * term->scale;
term->mouse.col = x / term->cell_width;
term->mouse.row = y / term->cell_height;