Skip to content

Commit

Permalink
Use video_driver_get_size to get width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickStankard committed Feb 20, 2024
1 parent 597a821 commit 4f4bdfe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions input/drivers/android_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,18 +647,18 @@ static int android_check_quick_tap(android_input_t *android)
static INLINE void android_mouse_calculate_deltas(android_input_t *android,
AInputEvent *event,size_t motion_ptr,int source)
{
settings_t *settings = config_get_ptr();
video_viewport_t *custom_vp = &settings->video_viewport_custom;
unsigned video_width, video_height;
video_driver_get_size(&video_width, &video_height);

float x = 0;
float x_delta = 0;
float x_min = 0;
float x_max = custom_vp->width;
float x_max = (float)video_width;

float y = 0;
float y_delta = 0;
float y_min = 0;
float y_max = custom_vp->height;
float y_max = (float)video_height;

/* AINPUT_SOURCE_MOUSE_RELATIVE is available on Oreo (SDK 26) and newer,
* it passes the relative coordinates in the regular X and Y parts.
Expand Down

0 comments on commit 4f4bdfe

Please sign in to comment.