X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0623b0f0014f99d327d293c772260bfca0fd91e0..75a438f9ac0303fec73b70d153c28b9a7269f121:/src/generic/datavgen.cpp diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index ba18a3bdea..3a29887b4b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1105,7 +1105,11 @@ bool wxDataViewToggleRenderer::WXActivateCell(const wxRect& cellRect, // 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;