Index: Globals.cpp =================================================================== --- Globals.cpp (revision 18395) +++ Globals.cpp (working copy) @@ -647,23 +647,32 @@ } +static short RoundMouseWheelToWholeStep(int value) +{ + if(value > 0) + return mpt::saturate_cast(mpt::align_up(value, WHEEL_DELTA)); + else + return mpt::saturate_cast(-mpt::align_up(-value, WHEEL_DELTA)); +} + + BOOL CModScrollView::OnMouseWheel(UINT fFlags, short zDelta, CPoint point) { // we don't handle anything but scrolling just now - if (fFlags & (MK_SHIFT | MK_CONTROL)) return FALSE; + if(fFlags & (MK_SHIFT | MK_CONTROL)) + return FALSE; - //if the parent is a splitter, it will handle the message - //if (GetParentSplitter(this, TRUE)) return FALSE; - // we can't get out of it--perform the scroll ourselves - return DoMouseWheel(fFlags, zDelta, point); + return DoMouseWheel(fFlags, RoundMouseWheelToWholeStep(zDelta), point); } void CModScrollView::OnMouseHWheel(UINT fFlags, short zDelta, CPoint point) { + zDelta = RoundMouseWheelToWholeStep(zDelta); + // we don't handle anything but scrolling just now - if (fFlags & (MK_SHIFT | MK_CONTROL)) + if(fFlags & (MK_SHIFT | MK_CONTROL)) { CScrollView::OnMouseHWheel(fFlags, zDelta, point); return;