Fixed constructor of wheel event.
Limited wheel event ticks to plus and minus one on Mac. Maarten PS Any volunteers for X11?
This commit is contained in:
parent
08c376d54c
commit
0df2cdbc2d
|
@ -565,11 +565,15 @@ OSStatus GHOST_SystemCarbon::handleMouseEvent(EventRef event)
|
|||
//GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed");
|
||||
status = ::GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, NULL, sizeof(axis), NULL, &axis);
|
||||
GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed");
|
||||
status = ::GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(delta), NULL, &delta);
|
||||
GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed");
|
||||
if (axis == kEventMouseWheelAxisY)
|
||||
{
|
||||
pushEvent(new GHOST_EventWheel(getMilliSeconds(), GHOST_kEventWheel, window, delta));
|
||||
status = ::GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(delta), NULL, &delta);
|
||||
GHOST_ASSERT(status == noErr, "GHOST_SystemCarbon::handleMouseEvent(): GetEventParameter() failed");
|
||||
/*
|
||||
* Limit mouse wheel delta to plus and minus one.
|
||||
*/
|
||||
delta = delta > 0 ? 1 : -1;
|
||||
pushEvent(new GHOST_EventWheel(getMilliSeconds(), window, delta));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue