From: Stefan Csomor Date: Sat, 8 Apr 2006 14:33:00 +0000 (+0000) Subject: changing coordinates to client-area relative (patch 1378189) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2fbfb7d6fba1bb0005fcd4623ed9667817770da4?ds=inline changing coordinates to client-area relative (patch 1378189) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 1e6e98a239..df02de6a4b 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -322,7 +322,13 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const #if TARGET_API_MAC_OSX const int countPages = GetPageCount(); - HIPoint hipoint = { pt.x , pt.y } ; + // we have to convert from Client to Window relative coordinates + wxPoint adjustedPt = pt + GetClientAreaOrigin(); + // and now to HIView native ones + adjustedPt.x -= MacGetLeftBorderSize() ; + adjustedPt.y -= MacGetTopBorderSize() ; + + HIPoint hipoint= { adjustedPt.x , adjustedPt.y } ; HIViewPartCode outPart = 0 ; OSStatus err = HIViewGetPartHit( m_peer->GetControlRef(), &hipoint, &outPart );