#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 );
}
if ( outPart >= 1 && outPart <= countPages )
- resultV = outPart ;
+ resultV = outPart - 1 ;
#endif // TARGET_API_MAC_OSX
if (flags != NULL)
*flags = 0;
// we cannot differentiate better
- if (resultV >= 1)
+ if (resultV >= 0)
*flags |= wxNB_HITTEST_ONLABEL;
else
*flags |= wxNB_HITTEST_NOWHERE;