Re: Smooth Scrolling



I don't really understand the old (nor the IE5 implementation), but I'd
imagine the best way to do it would involve keeping the current scroll
values and just having something constantly adjust the position of the
scrolled canvas to follow certain rules.

I'd say, 250ms is probably reasonable - so you could calculate a
position based on registered scrolling position and actual current
position. That way if you tell it to scroll loads, it will simply scroll
faster and faster to catch up. In any event, it will be at where you
told it to be 250ms after you stop scrolling. The relationship should be
eased somehow, mathematically, to give the easiest viewing experience.

Interestingly, this would cause an explicitly programmed scroll request
to cause the pane to smoothly scroll from its initial position to where
it is supposed to be. This may or may not be desirable - though in my
experience I find it somewhat confusing when I open up a document in
GEdit and it has scrolled to the last place it remembers automatically -
if there was a quick 250ms scroll in there from the top to where it is
supposed to be, it would become much more apparent to my brain that it
is scrolled.

Otherwise, some API could be added to disable the "smoothing" for a
particular scroll request. Or maybe it could even be the other way
around.

What do you think?


On Tue, 2007-03-27 at 19:26 +0200, Xavier Bestel wrote:
> Le mardi 27 mars 2007 à 09:00 -0600, Michael L Torrie a écrit :
> > Smooth scrolling is only good if it is very fast (as fast as without
> > smooth scrolling) and totally synchronized with both the redraw and the
> > mouse wheel's speed, in order to eliminate tearing and stuttering.  I
> > think we're finally to the point where it could be done right.
> 
> It depends. On my Athlon64 3000+, scrolling the listview in Evolution
> lags quite a bit (I can manage a 1s lag).
> 
> > IE 5,  if I recall correctly, had smooth scrolling and it was the first
> > thing most I turned off because it was so annoying.  It had a constant
> > lag and, because of the scroll "steps" (ie one click of the scroll wheel
> > is so many lines) it would hesitate and appear to stutter.  Half the
> > time it would have to catch up to you.  Was awful. 
> 
> I know what you mean, but CygnusEd's scrolling had a bit of lag and was
> really good to use. Unlike IE's scroll which looks like it starts a bit
> after you move the wheel, it felt light and natural.
> Does anyone know of a current texteditor/testwidget with smooth
> scrolling that works well ?
> 
> 	Xav
> 
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
-- 
Alex Jones
http://alex.weej.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]