From 20ab5edbe913fb46ef70eaa712b9c3a885deb0fa Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Thu, 4 Sep 2008 19:57:31 +0000 Subject: [PATCH] * In BeOS R5 BListItem::DrawItem frame.left is always 0 regardless of BListView origin or update rectangle. This fixes the horizontal scrolling bug in FlattenPictureTest application. * When the list is scrolled horizontally ScrollToSelection() resets the origin x-coordinate to 0. When using the keyboard to move to the next or previous item this is not desired. Now the x-coordinate is not changed from its old value anymore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27328 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/ListView.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index 6ef594c99d..287355cef7 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -179,7 +179,7 @@ BListView::Draw(BRect updateRect) if (count == 0) return; - BRect itemFrame(Bounds().left, 0, Bounds().right, -1); + BRect itemFrame(0, 0, Bounds().right, -1); for (int i = 0; i < count; i++) { BListItem* item = ItemAt(i); itemFrame.bottom = itemFrame.top + ceilf(item->Height()) - 1; @@ -800,9 +800,9 @@ BListView::ScrollToSelection() return; if (itemFrame.top < Bounds().top) - ScrollTo(0, itemFrame.top); + ScrollTo(itemFrame.left, itemFrame.top); else - ScrollTo(0, itemFrame.bottom - Bounds().Height()); + ScrollTo(itemFrame.left, itemFrame.bottom - Bounds().Height()); } @@ -1023,7 +1023,6 @@ BListView::ItemFrame(int32 index) frame.bottom = -1; } else { BListItem* item = ItemAt(index); - frame.left = 0.0; frame.top = item->Top(); frame.bottom = item->Bottom(); }