mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Merge pull request #102 from shurcooL/patch-1
Fixed OS X precise scrolling delta logic.
This commit is contained in:
commit
5b8ff4a2fc
|
@ -609,7 +609,7 @@ static int translateKey(unsigned int key)
|
|||
double deltaX, deltaY;
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
if ([event respondsToSelector:@selector(hasPreciseScrollingDeltas:)])
|
||||
if ([event respondsToSelector:@selector(hasPreciseScrollingDeltas)])
|
||||
{
|
||||
deltaX = [event scrollingDeltaX];
|
||||
deltaY = [event scrollingDeltaY];
|
||||
|
@ -621,12 +621,11 @@ static int translateKey(unsigned int key)
|
|||
}
|
||||
}
|
||||
else
|
||||
#else
|
||||
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||
{
|
||||
deltaX = [event deltaX];
|
||||
deltaY = [event deltaY];
|
||||
}
|
||||
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||
|
||||
if (fabs(deltaX) > 0.0 || fabs(deltaY) > 0.0)
|
||||
_glfwInputScroll(window, deltaX, deltaY);
|
||||
|
|
Loading…
Reference in New Issue
Block a user