[PATCH 2/2] user32/listbox: Handle Mouse Wheel scrolling for multi-column listboxes properly

Ken Thomases ken at codeweavers.com
Wed Aug 22 13:15:49 CDT 2018


On Aug 22, 2018, at 12:48 PM, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> 
> On 08/22/2018 06:49 PM, Ken Thomases wrote:
> 
>> To be honest, I don't clearly remember why I put the float cast in there.  I think perhaps to avoid potential (if unlikely) integer overflow.  We want something like MulDiv() but always rounding toward zero.  Perhaps just casting to INT64 would be better.
> 
> I like MulDiv better. Gabriel, do you think it's possible to get rid of some casts by changing variable types?

But MulDiv() rounds to the nearest integer (sometimes rounding up), which isn't acceptable.  It can lead to scrolling too far and/or end up reversing the sign of wheel_remain.

-Ken




More information about the wine-devel mailing list