Skip to content

Commit ab3b175

Browse files
authored
Restore missed absolute mouse conversion. (#17343)
1 parent 0913263 commit ab3b175

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

input/drivers/udev_input.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,8 @@ static bool udev_mouse_get_pointer(const udev_input_mouse_t *mouse,
800800
{
801801
/* mouse coordinates are relative to the full screen; convert them
802802
* to be relative to the viewport */
803-
scaled_x = mouse->x_abs - mouse->x_min;
804-
scaled_y = mouse->y_abs - mouse->y_min;
803+
scaled_x = vp.full_width * (mouse->x_abs - mouse->x_min) / (mouse->x_max - mouse->x_min + 1);
804+
scaled_y = vp.full_height * (mouse->y_abs - mouse->y_min) / (mouse->y_max - mouse->y_min + 1);
805805
}
806806
else /* mouse coords are viewport relative */
807807
{

0 commit comments

Comments
 (0)