Do not scroll List items unless selected item is out of view#218
Do not scroll List items unless selected item is out of view#218ardnew wants to merge 1 commit intorivo:masterfrom
Conversation
|
Totally agree with the requirement described in #217. However, here again, I'm providing my own implementation (see 0a17957), mostly because I find the use of two So I'll close this one without merging. Hope you don't mind. |
|
That -1/+1/0 is bad habit from my C programming, where that idiom is used pretty extensively, such as in
|
|
I know Thanks anyway for your submission. It's always interesting to see a different approach. |
This change adds a single new field
viewOffsetto theListstruct because it is impossible (I'm pretty sure) to determine which items should be drawn at any given instant with only the state information available whenDraw()is called.This new
viewOffsetfield effectively remembers where the view existed the last timeDraw()was called, and from that along with the currently selected item, determines which items need to be drawn.Please test this out, it felt very natural to me, but I haven't looked to see if
TableorTreeViewwould also benefit from the same logic.This resolves issue #217