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:
Ingo Weinhold
2009-06-27 16:39:42 +00:00
parent e0965f2727
commit 17a8a6f74b
+7 -2
View File
@@ -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);
}
}