Don't set the event type until we are sure it is a vertical wheel event. (Horizontal wheel events are not
supported in 2.8 and can cause a divide-by-zero if they are handled incorrectly.) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -364,13 +364,12 @@ void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
|
|||||||
|
|
||||||
case kEventMouseWheelMoved :
|
case kEventMouseWheelMoved :
|
||||||
{
|
{
|
||||||
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
|
|
||||||
|
|
||||||
EventMouseWheelAxis axis = cEvent.GetParameter<EventMouseWheelAxis>(kEventParamMouseWheelAxis, typeMouseWheelAxis) ;
|
EventMouseWheelAxis axis = cEvent.GetParameter<EventMouseWheelAxis>(kEventParamMouseWheelAxis, typeMouseWheelAxis) ;
|
||||||
SInt32 delta = cEvent.GetParameter<SInt32>(kEventParamMouseWheelDelta, typeSInt32) ;
|
SInt32 delta = cEvent.GetParameter<SInt32>(kEventParamMouseWheelDelta, typeSInt32) ;
|
||||||
|
|
||||||
if ( axis == kEventMouseWheelAxisY )
|
if ( axis == kEventMouseWheelAxisY )
|
||||||
{
|
{
|
||||||
|
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
|
||||||
wxevent.m_wheelRotation = delta;
|
wxevent.m_wheelRotation = delta;
|
||||||
wxevent.m_wheelDelta = 1;
|
wxevent.m_wheelDelta = 1;
|
||||||
wxevent.m_linesPerAction = 1;
|
wxevent.m_linesPerAction = 1;
|
||||||
|
Reference in New Issue
Block a user