]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing incorrect scrolling - which happened at least under OSX ...
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 19 Sep 2012 08:18:15 +0000 (08:18 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 19 Sep 2012 08:18:15 +0000 (08:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 51347f51e57995367ac9a366564e24450b45e384..42a9352fee253fa7296f9f3905baae1401cd9804 100644 (file)
@@ -2267,12 +2267,17 @@ void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item)
 
     // update the control before scrolling it
     if (m_dirty)
-#if defined( __WXMSW__ ) || defined(__WXMAC__)
+    {
+#if defined( __WXMSW__ ) 
         Update();
+#elif defined(__WXMAC__)
+        Update();
+        DoDirtyProcessing();
 #else
         DoDirtyProcessing();
 #endif
-
+    }
+        
     wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem;
 
     int itemY = gitem->GetY();
@@ -2289,6 +2294,12 @@ void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item)
     {
         // need to scroll up by enough to show this item fully
         itemY += itemHeight - clientHeight;
+#ifdef __WXOSX__
+        // because itemY below will be divided by PIXELS_PER_UNIT it may
+        // be rounded down, with the result of the item still only being 
+        // partially visible, so make sure we are rounding up
+        itemY += PIXELS_PER_UNIT-1;
+#endif
     }
     else if ( itemY > start_y*PIXELS_PER_UNIT )
     {