From: Robin Dunn Date: Tue, 5 Oct 2004 18:24:13 +0000 (+0000) Subject: Improve image hittest X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d5a0636fa0ef9772058222da3d9707505af10f28?ds=sidebyside;hp=576f712776551bc0261005ff7a8c508d37481baa Improve image hittest git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp index 260d264ff7..79024a3bcc 100644 --- a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp @@ -1676,8 +1676,10 @@ wxTreeListItem *wxTreeListItem::HitTest(const wxPoint& point, } // check for image hit - if (theCtrl->m_imgWidth > 0) { + if (theCtrl->m_imgWidth > 0 && GetImage() != NO_IMAGE) { int imgX = m_x - theCtrl->m_imgWidth2; + if (HasPlus() && theCtrl->HasButtons()) + imgX += theCtrl->m_btnWidth + LINEATROOT; int imgY = y_mid - theCtrl->m_imgHeight2; if ((point.x >= imgX) && (point.x <= (imgX + theCtrl->m_imgWidth)) && (point.y >= imgY) && (point.y <= (imgY + theCtrl->m_imgHeight))) {