Restore missed absolute mouse conversion. (#17343)

This commit is contained in:
zoltanvb 2025-01-05 03:50:47 +01:00 committed by GitHub
parent 0913263817
commit ab3b175848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -800,8 +800,8 @@ static bool udev_mouse_get_pointer(const udev_input_mouse_t *mouse,
{ {
/* mouse coordinates are relative to the full screen; convert them /* mouse coordinates are relative to the full screen; convert them
* to be relative to the viewport */ * to be relative to the viewport */
scaled_x = mouse->x_abs - mouse->x_min; scaled_x = vp.full_width * (mouse->x_abs - mouse->x_min) / (mouse->x_max - mouse->x_min + 1);
scaled_y = mouse->y_abs - mouse->y_min; scaled_y = vp.full_height * (mouse->y_abs - mouse->y_min) / (mouse->y_max - mouse->y_min + 1);
} }
else /* mouse coords are viewport relative */ else /* mouse coords are viewport relative */
{ {