GetBoundingRect() is supposed to return the logical coordinates, even in !textOnly case; also documented it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2887,12 +2887,9 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
|
||||
|
||||
wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem;
|
||||
|
||||
int startX, startY;
|
||||
GetViewStart(& startX, & startY);
|
||||
|
||||
if ( textOnly )
|
||||
{
|
||||
rect.x = i->GetX() - startX*PIXELS_PER_UNIT;
|
||||
rect.x = i->GetX();
|
||||
rect.width = i->GetWidth();
|
||||
|
||||
if ( m_imageListNormal )
|
||||
@@ -2908,9 +2905,16 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
|
||||
rect.width = GetClientSize().x;
|
||||
}
|
||||
|
||||
rect.y = i->GetY() - startY*PIXELS_PER_UNIT;
|
||||
rect.y = i->GetY();
|
||||
rect.height = GetLineHeight(i);
|
||||
|
||||
// we have to return the logical coordinates, not physical ones
|
||||
int startX, startY;
|
||||
GetViewStart(& startX, & startY);
|
||||
|
||||
rect.x -= startX*PIXELS_PER_UNIT;
|
||||
rect.y -= startY*PIXELS_PER_UNIT;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user