Make gridview:scrollToCell move at a consistent speed


Maybe this counts as a bug? Currently, when I scroll a grid view (linear easing) exactly 2 pixels per frame, it's not smooth.

Example: scrolling 54 vertical pixels in 27 frames (verified frame-by-frame in Mac Preview with the attached GIF recording—the movement starts on frame 3). It should ideally move a consistent 2 px every frame—but instead, movement varies between 1 and 3 px per frame.

This makes the motion not feel smooth. It also means I can't prevent dither-flicker (by managing setScrollDuration and cell width/height to insure 2 px movement per frame).

(Specifically: the first and last frames both move just 1 px, while a couple of frames in the middle jump 3 px to compensate. Maybe that's a clue to a fix?)

It would be great if grid views' amazing built-in scrolling capabilities were more consistent in distance-per-frame (with linear easing).

(Going even further, an option to quantize ALL gridview scrolling—with ANY easing—to 2 px increments would be great! I do that when implementing my own motions and it really helps avoid dither-flicker. But failing that, just addressing the above issue would be awesome!)

scrollToCell example
(When viewed on hardware, the slight flicker becomes more extreme.)

Thanks for pointing this out! There are all kinds of things that could be affecting the scroll rate, depending on what else is going on, but I am going to do some investigating to see if anything fishy is going on - I agree it would be nice to move at a consistent rate if possible!

I also like the idea of snapping to 2-pixel increments to reduce flicker! I've filed a bug to look into this, hopefully I'll get a chance to look into it soon.

1 Like

I also noticed this based on the sound played when you move between cells - the intervals are not regular.