[USER32] Fixed scrolling by mouse wheel issue

This commit is contained in:
Jose Carlos Jesus 2019-12-19 16:31:34 +00:00 committed by Mark Jansen
parent a4483d79da
commit d0a6727637

View file

@ -321,14 +321,15 @@ static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll )
}
else
diff = (descr->top_item - index) * descr->item_height;
#ifdef __REACTOS__
if (descr->style & LBS_MULTICOLUMN)
ScrollWindowEx(descr->self, diff, 0, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN);
else
#endif
ScrollWindowEx(descr->self, 0, diff, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN);
ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
}
else
InvalidateRect( descr->self, NULL, TRUE );
@ -2034,6 +2035,10 @@ static LRESULT LISTBOX_HandleMouseWheel(LB_DESCR *descr, SHORT delta )
pulScrollLines = min((UINT) descr->page_size, pulScrollLines);
cLineScroll = pulScrollLines * (float)descr->wheel_remain / WHEEL_DELTA;
descr->wheel_remain -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
#ifdef __REACTOS__
if (cLineScroll < 0)
cLineScroll -= descr->page_size;
#endif
LISTBOX_SetTopItem( descr, descr->top_item - cLineScroll, TRUE );
}
return 0;