Use correct cell alignment in generic wxDataViewCtrl mouse handling code.
Don't fall back to wxALIGN_CENTRE, even if the renderer doesn't specify its own alignment we still have to take the column alignment in consideration, so use GetEffectiveAlignment() (which had to be made public for this). This notably fixes (again) hit testing for wxDataViewToggleRenderer in the generic version. Closes #15731. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4412,9 +4412,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
||||
// see #12270.
|
||||
|
||||
// adjust the rectangle ourselves to account for the alignment
|
||||
int align = cell->GetAlignment();
|
||||
if ( align == wxDVR_DEFAULT_ALIGNMENT )
|
||||
align = wxALIGN_CENTRE;
|
||||
const int align = cell->GetEffectiveAlignment();
|
||||
|
||||
wxRect rectItem = cell_rect;
|
||||
const wxSize size = cell->GetSize();
|
||||
|
Reference in New Issue
Block a user