Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11397 from TellowKrinkle/QuartzMousePos
InputCommon:QuartzKB&M: Fix mouse y coordinates
  • Loading branch information
AdmiralCurtiss committed Jan 2, 2023
2 parents f13f54e + 8659de4 commit d949aa6
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -259,16 +259,14 @@ - (void)dealloc
}
else
{
CGEventRef event = CGEventCreate(nil);
CGPoint loc = CGEventGetLocation(event);
CFRelease(event);
NSPoint loc = [NSEvent mouseLocation];

const auto window_scale = g_controller_interface.GetWindowInputScale();

loc.x -= bounds.origin.x;
loc.y -= bounds.origin.y;
m_cursor.x = (loc.x / window_width * 2 - 1.0) * window_scale.x;
m_cursor.y = (loc.y / window_height * 2 - 1.0) * window_scale.y;
m_cursor.y = (loc.y / window_height * 2 - 1.0) * -window_scale.y;
}
}

Expand Down

0 comments on commit d949aa6

Please sign in to comment.