Smooth scrolling algorithm change (Re: KDE/kdelibs/khtml)

Allan Sandfeld Jensen kde at carewolf.com
Sat May 31 12:56:04 BST 2008


On Friday 30 May 2008, Germain Garand wrote:
> Le vendredi 30 mai 2008, Allan Sandfeld Jensen a écrit :
> > Hi Germain
> >
> > On Friday 30 May 2008, Germain Garand wrote:
> > > I'm sorry but I really dislike this change. It dramatically changes the
> > > feeling, and in not so nice a way.
> > > It's not clear to me why you felt it was needed, so I'll give you a
> > > full view of my approach to this feature - please tell me what exactly
> > > you feel is wrong with it.
> >
> > I think you have missed a lot in how the new algorithm works and how
> > simple it really is. The integer-calculations with remainder makes it
> > look more complicated than it really is.
>
> hmm, then visibly, what I'm missing is something that actually work as you
> describe (I'd love to try it).
>
> Problem is: it doesn't. I didn't made up the numbers, they are what's
> produced here when applying some simple instrumentation with the attached
> patch, and using the mouse wheel.
>
> The result has changed slightly with your addition of today (I now see one
> slowing down step), but it still doesn't match you description at all:
>
> setupSmoothScrolling: Smooth scrolling starting for  -80 vertical pixels
> scrollTick: -14
> scrollTick: -15
> scrollTick: -14
> scrollTick: -15
> scrollTick: -14
> scrollTick: -8
> scrollTick: Elapsed:  85
>
> Any idea what's wrong?

Yes, maybe there is a deacceleration bug around 0.5px/step^2, so it only 
deaccelerates right for larger distances.

The issue is that for negative values of ddx the remainder calculation might 
not work: (x/16)*16 + x%16 = x, maybe only applies for positive numbers of x.

The attached patch should fix it if I am right, but I don't have time to 
actually test it myself until monday.

Regards
`Allan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: khtmlview.diff
Type: text/x-diff
Size: 1018 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080531/3c974ded/attachment.diff>


More information about the kfm-devel mailing list