]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix off by 1 error in wxGenericListCtrl::HitTest().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Feb 2013 13:48:20 +0000 (13:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Feb 2013 13:48:20 +0000 (13:48 +0000)
Account for the header height if the header is present.

Closes #15063.

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

docs/changes.txt
src/generic/listctrl.cpp

index 2a24661b7094fac13be0637eacb06feee5c0574f..e8aa7743e7acd2522a719a0f97aea7fd66a44e78 100644 (file)
@@ -621,6 +621,7 @@ All (GUI):
 - Add wxMask::GetBitmap() for wxMSW, wxGTK and wxOSX
 - Add wxCheckListBox::GetCheckedItems() (hartwigw).
 - Add wxAUI_TB_PLAIN_BACKGROUND wxAuiToolBar style (Allann Jones).
+- Fix off by 1 error in wxGenericListCtrl::HitTest() (Daniel Hyams).
 
 wxGTK:
 
index b311e031eff67ba789fe96a2a30d8b37906bce6a..caebe00001f54bc9b2008541402a5a6b0dffde32 100644 (file)
@@ -4144,6 +4144,10 @@ long wxListMainWindow::HitTest( int x, int y, int &flags ) const
 
     if ( InReportView() )
     {
+        // Account for the header height if it's present.
+        if ( HasHeader() )
+            y -= GetListCtrl()->m_headerWin->GetSize().y + 1;
+
         size_t current = y / GetLineHeight();
         if ( current < count )
         {