From: Julian Smart <julian@anthemion.co.uk>
Date: Sat, 25 Nov 2006 21:12:31 +0000 (+0000)
Subject: Fix tree size calculation by using logical item position
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9e7642ae0d20232698aeeb6a35b526826b006ab8

Fix tree size calculation by using logical item position


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp
index d4244576a7..4eebd5fa09 100644
--- a/src/common/treebase.cpp
+++ b/src/common/treebase.cpp
@@ -113,6 +113,10 @@ wxGetBestTreeSize(const wxTreeCtrlBase* treeCtrl, wxTreeItemId id, wxSize& size)
 
     if ( treeCtrl->GetBoundingRect(id, rect, true /* just the item */) )
     {
+        // Translate to logical position so we get the full extent
+        rect.x += treeCtrl->GetScrollPos(wxHORIZONTAL);
+        rect.y += treeCtrl->GetScrollPos(wxVERTICAL);
+
         size.IncTo(wxSize(rect.GetRight(), rect.GetBottom()));
     }