WTreeView::scrollTo() and more...
The documentation of WTreeView says that 'EnsureVisible' provides minimal scrolling, but WTreeView::scrollTo() does exactly the opposite (scrolling 'toTop' if desired entry is below the bottom visible entry and vice versa). In addition there is some wrong calculation in getIndexRow() leading to wrong viewport adjustment in scrollTo().
Attached you will find a version of WTreeView.C (based on release 4.0.4) which fixes these issues. Watch out for comments starting with 'TF :'.
I'm still busy hunting down some other bugs in TreeView.C, which lead to wrong calculations of the '_viewport' and constant display of 'loading...' in the browser, especially when scrolling through large trees. This is with and without the attached fixes.
Updated by Thomas Frank over 3 years ago
Just found out, that the latest version of WTreeView.C at github fixes all the 'loading...'-issues! Great!!
I incorporated the fixed versions of WTreeView::scrollTo() and WTreeView::getIndexRow() into the latest WTreeView.C from github.
I know that this is now the 3rd attached version, but I hope that these fixes will make it into the next version anyway...