diff --git a/docs/changes.txt b/docs/changes.txt index 2a24661b70..e8aa7743e7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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: diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b311e031ef..caebe00001 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -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 ) {