Made ScrollTo(BRow*) more useful. Now it only scrolls, if the row isn't fully
visible and it only scrolls as much as necessary. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31268 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4428,8 +4428,13 @@ void
|
||||
OutlineView::ScrollTo(const BRow* row)
|
||||
{
|
||||
BRect rect;
|
||||
if (FindRect(row, &rect))
|
||||
ScrollTo(BPoint(rect.left, rect.top));
|
||||
if (FindRect(row, &rect)) {
|
||||
BRect bounds = Bounds();
|
||||
if (rect.top < bounds.top)
|
||||
ScrollTo(BPoint(bounds.left, rect.top));
|
||||
else if (rect.bottom > bounds.bottom)
|
||||
ScrollBy(0, rect.bottom - bounds.bottom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user