[haiku-commits] r42120 - haiku/trunk/src/kits/interface

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 12 Jun 2011 04:27:17 +0200 (CEST)

Author: anevilyak
Date: 2011-06-12 04:27:17 +0200 (Sun, 12 Jun 2011)
New Revision: 42120
Changeset: https://dev.haiku-os.org/changeset/42120

Modified:
   haiku/trunk/src/kits/interface/ListView.cpp
Log:
Remove unnecessary calculations from BListView::ScrollToSelection(). At least I
see no useful purpose to the distinction made here.



Modified: haiku/trunk/src/kits/interface/ListView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ListView.cpp 2011-06-12 02:12:07 UTC (rev 
42119)
+++ haiku/trunk/src/kits/interface/ListView.cpp 2011-06-12 02:27:17 UTC (rev 
42120)
@@ -1022,10 +1022,7 @@
        if (Bounds().Contains(itemFrame))
                return;
 
-       if (itemFrame.top < Bounds().top)
-               ScrollTo(itemFrame.left, itemFrame.top);
-       else
-               ScrollTo(itemFrame.left, itemFrame.bottom - Bounds().Height());
+       ScrollTo(itemFrame.left, itemFrame.top);
 }
 
 
@@ -1801,7 +1798,7 @@
 
        from = max_c(0, from);
        to = min_c(to, CountItems() - 1);
-       
+
        if (fAnchorIndex != -1) {
                if (fAnchorIndex == from)
                        fAnchorIndex = to;
@@ -1818,7 +1815,7 @@
 
        if (fFirstSelected > from)
                from = fFirstSelected;
-               
+
        fLastSelected = fFirstSelected;
        for (int32 i = from; i <= to; i++) {
                if (ItemAt(i)->IsSelected())


Other related posts: