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:
Robin Dunn
2007-08-21 20:04:49 +00:00
parent 013cbef2d9
commit 818a665f80

View File

@@ -364,13 +364,12 @@ void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
case kEventMouseWheelMoved :
{
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
EventMouseWheelAxis axis = cEvent.GetParameter<EventMouseWheelAxis>(kEventParamMouseWheelAxis, typeMouseWheelAxis) ;
SInt32 delta = cEvent.GetParameter<SInt32>(kEventParamMouseWheelDelta, typeSInt32) ;
if ( axis == kEventMouseWheelAxisY )
{
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
wxevent.m_wheelRotation = delta;
wxevent.m_wheelDelta = 1;
wxevent.m_linesPerAction = 1;