The changes of r73835 fixed hit testing in horizontal direction but broke it
in the vertical one as the computed checkbox rectangle was not relative to the
cell rectangle as it should have been. Do fix this now.
See #15144.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73838
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// as this is how it's rendered, at least under MSW. If this turns out
// to be a wrong assumption, we probably would need to do the hit test
// checking in wxRendererNative but for now this simple solution works.
- const wxRect checkRect = wxRect(GetSize()).CentreIn(cellRect);
+ wxRect checkRect = wxRect(GetSize()).CentreIn(cellRect);
+
+ // After centering in cellRect, we need to pull it back to (0, 0) as
+ // the mouse coordinates passed to us are relative to cellRect already.
+ checkRect.Offset(-cellRect.GetPosition());
if ( !checkRect.Contains(mouseEvent->GetPosition()) )
return false;